Results 1 to 2 of 2

Thread: Featured Content Slider v2.4 pause 1 slide longer than others

  1. #1
    Join Date
    Oct 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Featured Content Slider v2.4 pause 1 slide longer than others

    1) Script Title: Featured Content Slider v2.4

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...tentslider.htm

    3) Describe problem: I need to pause the first slide longer than the rest. I would assume that i would do this in the onchange portion of the javascript in the init function, but what is the syntax to do so?

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,076
    Thanks
    44
    Thanked 3,216 Times in 3,178 Posts
    Blog Entries
    12

    Default

    This is actually a bit more complex than may at first appear, but after a bit of trial and error this looks pretty good. I found it best to add another function - prolong, to deal with the first time around, here's an example of what to do:

    Code:
    featuredcontentslider.init({
    	id: "slider1",  //id of main slider DIV
    	contentsource: ["inline", ""],  //Valid values: ["inline", ""] or ["ajax", "path_to_file"]
    	toc: "#increment",  //Valid values: "#increment", "markup", ["label1", "label2", etc]
    	nextprev: ["Previous", "Next"],  //labels for "prev" and "next" links. Set to "" to hide.
    	revealtype: "click", //Behavior of pagination links to reveal the slides: "click" or "mouseover"
    	enablefade: [true, 0.2],  //[true/false, fadedegree]
    	autorotate: [true, 3000],  //[true/false, pausetime]
    	enablepersist: false, //true/false - defaults to false
    	random: false, //true/false - defaults to false (requires autorotate be set to true with a pausetime)
    	prolong: function(){
    		this.contentdivs[0].style.visibility = 'visible';
    		this.contentdivs[0].style.display = 'block';
    		this.prolong = function(){};
    	},
    	onChange: function(previndex, curindex){  //event handler fired whenever script changes slide
    		//previndex holds index of last slide viewed b4 current (1=1st slide, 2nd=2nd etc)
    		//curindex holds index of currently shown slide (1=1st slide, 2nd=2nd etc)
    		if(!this.autorotate[0] || curindex !== 1) return;
    		var setting = this;
    		featuredcontentslider.cleartimer(this, window['fcsautorun' + this.id]);
    		this.prolong.apply(this);
    		window['fcsautorun' + this.id] = setTimeout(function(){featuredcontentslider.autorotate(setting);}, this.autorotate[1]);
    	}
    })
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •