Results 1 to 3 of 3

Thread: Featured Content Slider v2.0 - get slide onload

  1. #1
    Join Date
    Jul 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Featured Content Slider v2.0 - get slide onload

    1) Script Title: Featured Content Slider v2.0

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

    3) Describe problem: Is there any way to load a specific slide when you loads the page? I have seen that you can use:

    ContentSlider.turnpage('slider_id' 3)

    But I can't get it to work.

    I.E:
    URL: www.test.com/index.aspx?sliderId=3

  2. #2
    Join Date
    Aug 2004
    Posts
    9,902
    Thanks
    3
    Thanked 967 Times in 955 Posts
    Blog Entries
    15

    Default

    There's no public methods right now for loading a specific slide other than the first one when the page loads. You can do this by first changing the line:

    Code:
    setting.currentpage=(this.enablepersist)? persistedpage : 1
    inside the .js file to:

    Code:
    setting.currentpage=(this.enablepersist)? persistedpage : setting.initialpage? setting.initialpage : 1
    Then, when initializing your featured contents, specify a "initialpage" parameter:


    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.
    enablefade: [true, 0.2], //[true/false, fadedegree]
    initialpage: 2, //page number to start off with
    autorotate: [true, 3000], //[true/false, pausetime]
    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)
    }
    })
    This is different from jumping to a page via a URL parameter though.

  3. #3
    Join Date
    Jul 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the reply. Can I add a new function in the js that gets the id in the url.

    var sliderId = 3;

    and then

    setting.currentpage=(this.enablepersist)? persistedpage : setting.initialpage? setting.initialpage : sliderId

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
  •