How do i use a different timeout value on my first element in JQuery cycle?

ShopSetup
ShopSetup used Ask the Experts™
on
I'm trying to have a different timeout (how long the div is showing before it fades out and the second element fades in) on my first element, wich in this case is a div.

How do i do that?
$(document).ready(function() {
 
$('#media_content') 
.after('<div id="nav">') 
.cycle({ 
fx:     'fade', 
speed:  '1000',
timeout: 4000, 
pager:  '#nav',
cleartype:  1
	    });
        });

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Hello ShopSetup,

I'm assuming your are using the jQuery plugin jQuery cycle. As said in the documentation you override the default settings to achieve your needs.

There is a 'delay' option that take a value in milliseconds for first transition. The code snippet attached show the use of delay.

Note, you can see the official documentation at: jQuery Cycle Documentation.

Hope it helps!

$(document).ready(function() {
  $('#media_content')
    .after('<div id="nav">')
    .cycle({
      fx:        'fade', 
      speed:     '1000',
      timeout:   4000, 
      pager:     '#nav',
      cleartype: 1,
      delay:     5000 // A delay of 5 secs. (5000ms).
  });
});

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial