Results 1 to 3 of 3

Thread: Use a URL or onClick to Display Content

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

    Default Use a URL or onClick to Display Content

    1) Script Title: Featured Content Glider

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

    3) Describe problem: Is there a way to use a URL or “onClick” to manually display a particular slide “content” without using pagination links to toggle? I would like to use a form button to trigger the appropriate content. More to the point, I would like to use a chained select menu with the Featured Content Glider.
    Last edited by Snookerman; 06-04-2009 at 03:18 PM.

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

    Default

    The function to call to go to a specific slide using arbitrary links (or otherwise) is the function:

    Code:
    featuredcontentglider.glide(glidersettings, pagenumber)
    Before you can use the above function though, you'll need to modify your initialization code so the settings entered into it is stored inside a variable. For example:

    Code:
    var glidersettings={
    	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(glidersettings)
    All I'm doing here is storing the settings in a variable before passing it into init(). With the settings cached, you can create an arbitrary link that jumps to page 3 when clicked on, for example:

    Code:
    <a href="javascript:featuredcontentglider.glide(glidersettings, 2)">Go to page 3</a>
    DD Admin

  3. #3
    Join Date
    Jun 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    That makes sense and it works great!

    Thank you, thank you, thank you.

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
  •