Forum Moderators: open

Message Too Old, No Replies

JQuery fadeOut function - duration problem

duration remains the same regardless of stated duration

         

dwpub

10:33 am on Feb 25, 2009 (gmt 0)

10+ Year Member



I'm using the JQuery fadeOut function on the first list element.

This is the code I have:


<script type="text/javascript">
var $j = jQuery.noConflict();
$j(document).ready(function(){
$j("#whatsnew > ul > li:first").fadeOut("10000");
});
</script>

html


<div id="whatsnew">
<ul>
<li>Title 1</li>
<li>Title 2</li>
</ul>
</div>

As you can see i've set the fade out to 10000 milliseconds (10 secs). However, regardless of what duration I put the fadeOut always seems to last only 1-2 secs.

The code i'm using has come straight from the JQuery site.

I've stripped the page to its bare bones, i.e. removed all other JS and html, to see if this was causing the problem, but still the fadeOut is the same duration 1-2 secs.

any input would be much appreciated.

Frank_Rizzo

11:13 am on Feb 25, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You have quotes around the timesetting. Quotes only need for "Fast" "Slow". Try this:

.fadeOut(10000)

dwpub

12:01 pm on Feb 25, 2009 (gmt 0)

10+ Year Member



Thanks for your prompt reply. I think what I had done is replace "slow" with "10000" and forgot to remove the quotes. Works perfectly now.

Thanks