Results 1 to 3 of 3

Thread: Featured Content Glider script reset without page reload

  1. #1
    Join Date
    Oct 2010
    Posts
    8
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Featured Content Glider script reset without page reload

    1) Script Title:
    Featured Content Glider

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

    3) Describe problem:
    I am using multiple instances of this Glider script on a page, though I'm using another script to allow the user to toggle the display of each instance of the Glider script.

    Is it possible to set it up so that when a user toggles on/off the display for each of the Glider scripts, it resets the newly displayed Glider script to be back to its first page?

    I see the parameter "persiststate", but this doesn't work because the page is not refreshing, the other script is just using CSS to hide/unhide the Glider scripts.

    If someone can at least point me in the right direction, that would be greatly appreciated.

    Thanks

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    You can get an instance of FCG to go to a particular slide from outside the pagination links by making a small adjustment to your initialization code. Specifically, first cache the settings for each FCG inside a variable before applying it to the init() function, for example:

    Code:
    var config1={
    	gliderid: "canadaprovinces", //ID of main glider container
    	contentclass: "glidecontent", //Shared CSS class name of each glider content
    	togglerid: "p-select", //ID of toggler container
    	remotecontent: "", //Get gliding contents from external file on server? "filename" or "" to disable
    	selected: 0, //Default selected content index (0=1st)
    	persiststate: false, //Remember last content shown within browser session (true/false)?
    	speed: 500, //Glide animation duration (in milliseconds)
    	direction: "downup", //set direction of glide: "updown", "downup", "leftright", or "rightleft"
    	autorotate: true, //Auto rotate contents (true/false)?
    	autorotateconfig: [3000, 2] //if auto rotate enabled, set [milliseconds_btw_rotations, cycles_before_stopping]
    }
    
    featuredcontentglider.init(config1)
    config1 should be an arbitrary but unique variable name for each instance of FCG on your page. With that change you can now go to a specific page within a FCG dynamically by calling the function:

    Code:
    featuredcontentglider.glide(config1, 0)
    where glider1 is the variable containing your FCG's settings, and 0=1st page, 1=2nd page to show etc. In your case, you'll call the above line inside your code that toggles the FCG most likely.
    DD Admin

  3. The Following User Says Thank You to ddadmin For This Useful Post:

    justin-nc (06-04-2011)

  4. #3
    Join Date
    Oct 2010
    Posts
    8
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thanks, that did the trick! Much appreciated!

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
  •