Troy III 272 Posting Pro

@SimonIoa, you are still late! Because once again you refuse to mark the thread as solved.
Secondly
You say "because (you've found) the solution days before"

Yet, everybody can see that your question was posted:
4 days ago;
and that my solution (to your problem- not mine) was also given:
4 days ago!

Meaning, exactly the same day you've asked the question. So…, people may be scratching their heads while asking:
How is it that you've found the solution days before even having the problem?

Ain't that the most ridiculous lie you've ever heard?

And...
No, SimonIoa - I said "that our vast community would be benefiting a lot more from marking helpful posts and solutions for what they are"
That is: SOLVED! Because you didn't, and I asked - why?

p.s.:
And you still haven't!

Troy III 272 Posting Pro

SimonIoa, thanks for the endorsements and all but I think that our vast community would be benefiting a lot more from marking helpful posts and solutions for what they are, because you didn't, - why?!

Troy III 272 Posting Pro

...and here is a fiddle http://jsfiddle.net/qyu9q09v/
is this how they used to look?

Troy III 272 Posting Pro

<a> is not an Anchor Element without a properly initialized href object.
It's the same as if you've written:

_> <z><img.../></z>

so it will inherit from HTMLUnknownElement Prototype.

But, your real problem is the <img> tags being nested into <a> elements.
Which are inline elements; have no layout; and no position in document flow.

Your css targeting images, which are relative. But relative to what?

So to cut the story short, [this] quick tweak of your existing css, will restore the presentation to its previous state:

.poster a img{ width:100%; height:100% }
.poster a { display: inline-block; }
.poster {
    width:25%;
    height:25%;
    position:absolute;
    margin-left:20px;
    z-index:0;
}
    .poster a,.poster img {
        -moz-border-radius: 50%;
        -webkit-border-radius: 50%;
        border-radius: 50%;
        height:55px; width:55px
    }
    .poster a:nth-child(1) {

        position:relative;
        bottom: -57%; left: 33%;
    }
    .poster a:nth-child(2) {

        position:relative;
        bottom: -15%; right:-6%;
    }
    .poster a:nth-child(3) {

        position:relative;
        bottom: 18%; left: 10%;
    }
    .poster a:nth-child(4) {

        position:relative;
        top: 10%; right: -17%;
    }
    .poster a:nth-child(5) {

        position:relative;
        top: 55%; right: 7%;
    }
    .poster a:nth-child(6) {

        position:relative;
        top: -20%; right: -40%;
        height:100px;
        width:100px

    }
Troy III 272 Posting Pro

"oh my god" - where am I?!!
panjiasmara, you never told us how did you call the function "showDiv()" in your original script.

Please do, because if it worked on other systems we can make it work on apple too.

Troy III 272 Posting Pro

What do you need the ID's of the images for?

Troy III 272 Posting Pro

the difference between var $name and var name is that whenever you see a person using $name in his code instead of normal name, avoid talking to him, avoid conversing with him, avoid WORKING with him, and if your girlfriend happens to know him drop her too, even if he's family. Otherwise take on him and make him your slave, the only thing they are good for, anyway :)

Troy III 272 Posting Pro

This fiddle is not working on my system but in case it works on an independent page, you can add a function containing clearInterval(tabCarousel); command to a mouseover event on a main tabs wrapper element.

Troy III 272 Posting Pro

I've just found this out from triall and error.

And no, you didn't! - I told you so.
Because there's absolutely nothing else to explain here You my friend should have marked this thread Solved.

Troy III 272 Posting Pro

So why am I downvoted, if you please care to explain?
Thanking me this way for giving you the most
accurate explanation posssible, - expecially when taking in account the fact that your question was far from clear.
What is this?

Troy III 272 Posting Pro

Can you please expand on your example code, (...not enough data to process...)

There has to be an alternative approach to the problem, probably not as convenient - but at least, one that will walk you across.

p.s.:
Yes it is true that to be able to use it, (refer to the currrent event),- supplying the event argument-name in the function in Firefox is mandatory, (since like forever). And it always has to be the first argument on the arguments namespace.

Troy III 272 Posting Pro

It is all unclear, can you please provide a testcase ?

Troy III 272 Posting Pro

correct, with the addition that the return statement will also exit the function at the exact point of insertion canceling all other statements that may follow!

Troy III 272 Posting Pro

That's to say the least an incorrect asumption.

This function:

function doesNothing(){
    return;
    var one = "Hello";
        var two = "Orange";
        var total = one + two;
        return total;
 }

is equivalent to:

    function doesNothing(){
        return;
     }

or even:

    function doesNothing(){
     //empty
     }

because a function without return also evaluates to undefined.

To better ilustrate this, suppose you have something like
( 2 + 2 ) in the program stream. After the expression evaluation parens will contain a pure integer ( 4 ). (In fact there will be no parens either but we are using them for illustration purposes).

Analogous to that, we can have a function ( doesnNothing() ), which after parsing time leaves parens containing ( undefined ).

That's in case the function either doesn't have a return statement, or the return statement has nothing to return. In all other cases it contains the returned value.

Be it a Boolean true or false, regardless... it doesn't change the return behavior.

So, are we getting there yet? :)

Troy III 272 Posting Pro

Of course you could have left the return statement out of your script syntax and most probably be writing a smaller footprint function to produce the (same) meant result.

You were shooting at (if we understood it well enough) discussing the use and the meaning of it.

The meaning of a certain expression is a subject to its context of its syntactical position. There is no main purpose on a dynamic and a live language like JavaScript.

The return statement is able to return any JavaScript value with no restriction;
Every possible JavaScript object or literal can be returned with return statement, including complex functions or their result which will also come from a return value.

The return statement is most often used on writing functional methods. In other cases it used to conditionally exit the execution process before the remaining statements of the function body are executed.

• The return statement has no meaning outside of a function , in that case an exception message will be thrown: "'return' statement outside of function"

It can also be used to conditionally break, that is, to exit a loop.

No language tells you how to use it. So it is up to the user's natural talent and obtained skill -to use it the way he/she means to formulate express and communicate a certain meaning.

Have fun

JorgeM commented: always providing awesome examples and explanations! +12
Troy III 272 Posting Pro

Adding a function to a variable before reading the function. In your second example.

the function return; capturing the function return onto a variable the value of which you will be feeding the document.write command.

I assume that this prettymuch rounds up the answer on return statement

Troy III 272 Posting Pro

In reality I'm not calling a variable as a function, I'm calling the function by the name of the variable.

They are both references::pointers to the assigned function object.

A note should be made that: There is a slight behavioral difference between them. With a function assigned to a variable, you cannot do something like:

var total = apple();
document.write(total);

var apple = function(){
     var one = "Hello";
     var two = "Orange";
     return one + two;
 }

as in:

var total = apple();
document.write(total);

function apple () {
     var one = "Hello";
     var two = "Orange";
     return one + two;
 }

Regards.

Troy III 272 Posting Pro

Shouldn't the write command be writting the combined scrings of both variables one & two based from the return value ?

No, because "total" is a local variable not available in global context of the "document.write".
Executing the "apple" function will of course return the assignment value of the variable 'total' but since there is nothing there to capture it, it will evaporate.

More elaborate approach would be to

var apple = function() {
     var one = "Hello";
     var two = "Orange";
     return one + two;
 }

var total = apple();

document.write(total);
writes: "HelloOrange"
Troy III 272 Posting Pro
[datepickerFld].disabled = true;

or for browsers which don't support boolean properties in exact maner please use the following syntax:

[datepickerFld].setAttribute("disabled", "disabled");

Cheers

Troy III 272 Posting Pro

@Violet,
generally spoken -it means that offset is more reliable than position in a mixed web environment.

I'm not sure I can recall well, but as I remember, the possition specs have changed in later standards.

Troy III 272 Posting Pro

alert box is a modal dialog, (meaning) 1. it should be able to freeze script executon; also 2. disallow focus to go back to the content window e.g. to further interact with the page while it (the alert box) is still open.

It looks like jQuery is using the showModalDialog command in its .dialog() method -which is not supported by Opera.

It means that this same jQuery method will only be able to produce a modeless alert box in Opera and other browsers who do not have support for * custom* modals.

Troy III 272 Posting Pro

"The .position() method allows us to retrieve the current position of an element relative to the offset parent."

Means: The current position of the nested element edge relative to its parent element edge.

If element wrapper has padding = 10px, and the nested element has style.left = 13px, plus margin-left = 30px, -its (the nested element) position().left will be = 23. (Its margin will not be taken into account, because the nested element edge is 30px outwards).

Whereas, the offset left will always report the distance from the left edge of the document. Meaning that if you are aiming to move/reposition the element relative to its immediate wrapper, you'd be using position left.

Regards.

Troy III 272 Posting Pro

Since prompt is a modal popup dialog you can however use a similar custom modal as in this confirm example.
Of course some good skills on styling and scripting will be immanent.

Troy III 272 Posting Pro

You can emulate them using the showModalDialog('customPrompt.htm',"", "") on browsers that support it, but than you'll have to write them (code them, style them, script them) yourself completely.

Troy III 272 Posting Pro

There are no jQuery dialogs [except DIV's emulating dialogs] and no you can't modify the builtin browser prompt default title.

Troy III 272 Posting Pro

Siberian, this thread was solved in a blink of pritaes eye, - you should have marked it: "solved" by now.

Regards

Troy III 272 Posting Pro

...that should fix it (JorgeM's advice)
and here is a ready to copy-paste (corrected) script...

<script type="text/javascript">

function checkEmail()
{

    var email = document.getElementById('xemail');

    //alert(email);

    var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

    if (!filter.test(email.value))
    {
    alert('Please provide a valid email address');
    email.focus;
    return false;
    }
}

</script>
Troy III 272 Posting Pro

Sir I am using these codes to clear all textboxes in form

Have you tried the reset button?

<form...>
.
.
.
<button type="reset" value="reset">clear</button>
</form>

or scripting:

document.forms[0].reset();
Troy III 272 Posting Pro

This is my pre-AJAX (1997-, technology) a live demo at: http://www.aeneidas.com/

Troy III 272 Posting Pro

[your input field].value

Troy III 272 Posting Pro

How about not trying to attach events to elements before they are created?!
Put the script that manipulates the DOM where it belongs: towards the end of the document body.

(the working code)

<!DOCTYPE html>
<html>
<head>

<title>Untitled Document</title>
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>

<style>
.none {
    display:none;
}
</style>
</head>

<body>
<input type="radio" name='thing' value='valuable' data-id="bank" />Running Event
<input type="radio" name='thing' value='valuable' data-id="school" />Other challenges
<div id="school" class="none">
<label for="name">What was the activity called?</label>
                <select id = "myList">
               <option value = "1">Virgin London Marathon</option>
               <option value = "2">Round the Island cycle challenge</option>
               <option value = "3">Kilimanjaro trek</option>
               <option value = "4">Thames Path Challenge</option>
             </select>


</div>
<div id="bank" class="none"><label for="name">What was the activity called?</label>
                <select id = "myList">
               <option value = "1">Pancake Making</option>
               <option value = "2">Egg and spoon race</option>
               <option value = "3">Sack race </option>
               <option value = "4">Three leg race</option>
             </select></div>
<script>

$(':radio').change(function (event) {
    var id = $(this).data('id');
    $('#' + id).addClass('none').siblings().removeClass('none');
});
</script>
</body>
</html>
iamthwee commented: nods +14
Troy III 272 Posting Pro

-Sorry maestro, your code ain't working on either one...

  • Firefox says:: TypeError: tab[i] is undefined
  • Chrome says:: Uncaught TypeError: Cannot read property 'className' of undefined
  • Explorer says:: Unable to get property 'className' of undefined or null reference

My question to you is why are you using a dumb statement like "Javascript not working in IE" instead of describing the problem you are having with firefox and chrome, "which are working fine" - instead?

Troy III 272 Posting Pro

thank you for your point of view.

Troy III 272 Posting Pro

(With experience) we get more pragmatic, reliable and conventional, but not better - "better" requires creativity, originality and so on...

when you are experienced you tend to avoid trials and go strait to results.

Troy III 272 Posting Pro

Perhaps if you find a job that actually interests you ...

Troy III 272 Posting Pro

Using a correct doctype will fix a drawing error provoked by instructing the browser to render HTML code as if xhtml.

Troy III 272 Posting Pro

you are using a wrong and obsolete DOCTYPE!

consider us9ng a standard <!DOCTYPE html>

Troy III 272 Posting Pro

Additionally, the JavaScript Original Name was LiveScript.

sorry my bad:
(additionally), the JavaScript Original Name is: LiveScript .

Troy III 272 Posting Pro

Additionally, the JavaScript Original Name was LiveScript .

Troy III 272 Posting Pro

why is it that it never happens to stick a fork in your eye while you eat?

Troy III 272 Posting Pro

What do you mean by:

But then I have to make sure I'm not overriding any existing functions, which I think I'm not, but still.

?

Why would that happen ?

Troy III 272 Posting Pro

Is there a way to make result=efg?

   var result  = alpha.match("efg");

Or even just remove everything infront of efg.

   var result = alpha.substring(alpha.match("efg").index);
Troy III 272 Posting Pro

if "menu-item" is a one-liner, you can:
check this : http://jsfiddle.net/8fySf/

Troy III 272 Posting Pro

Here you can try this function :

function setImage(targetElement, imageURL) {    
    if (typeof(targetElement)=="string") 
    { 
        targetElement = document.getElementById(targetElement);

        targetElement.style.filter = 
            "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + 
            imageURL + 
            "',sizingMethod='scale')";
    }
}

setImage( [arg1], [arg2] );

arg1 - a) image container element or b)its "id"; //format: a) object, or b) "string ";
arg2 - url\image ; //format: "sring" only;

Troy III 272 Posting Pro

You are correct,
the second dd is the actual dd [object] in fact. The 'first' is its name ['handle'].

Troy III 272 Posting Pro

It will gain you a "dd" method of "menu" object, which you can invoke with:
menu.dd(*[arg]*)

Troy III 272 Posting Pro

jQuery bugs are to be solved with jquery team

Troy III 272 Posting Pro

You are misusing IDs for something they were never meant too - don't do that!

Troy III 272 Posting Pro

have you tried it?

Troy III 272 Posting Pro

This is doable, but it will require some scripting...
But I see another problem;

You say: "2.) The user entered a word,...", and pressed the enter key".
My question is, -where will the user enter the word?
Given the heads-up that: "There is no input box where the user enters "cow".

Your end-users/clients,-In case that they'll understand (if they understand) the "task" (about being required to type names of things they see on the page), they will also be forced on blind-typing!
Which is, a bad experience, as they say.