Results 1 to 4 of 4

Thread: Featured Content Slider

  1. #1
    Join Date
    Dec 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Featured Content Slider

    1) Script Title: Featured Content Slider

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

    3) Describe problem: I would like to make the menu be customizable as far as content. I mean, I would like the buttons to say "News" "Photos" etc. rather than "1" "2" "3" "Next" Is there any way to do this?
    Thank you

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Yes but, there are two levels of difficulty involved depending upon if you want more than one Featured Content Slider on a page with more than one set of customized links or not. For just one set of customized links used with one or more sliders on a page, edit contentslider.js here:

    Code:
    for (var i=0; i<slidernodes[sliderid].length; i++) //For each DIV within slider, generate a pagination link
    pcontent+='<a href="#" onClick=\"ContentSlider.turnpage(\''+sliderid+'\', '+i+'); return false\">'+(i+1)+'</a> '
    pcontent+='<a href="#" style="font-weight: bold;" onClick=\"ContentSlider.turnpage(\''+sliderid+'\', parseInt(this.getAttribute(\'rel\'))); return false\">Next</a>'
    in the function called:

    ContentSlider.buildpagination=function(sliderid)

    What you can do is use an array of custom links (use as many thelinks[#]'s as you need):

    Code:
    var thelinks=[];
    thelinks[0]='News';
    thelinks[1]='Photos';
    thelinks[2]='etc.';
    Place the array at the top of the script before anything else. Then in the part we were looking at before, do this (change is in red, scroll the code section to see it):

    Code:
    for (var i=0; i<slidernodes[sliderid].length; i++) //For each DIV within slider, generate a pagination link
    pcontent+='<a href="#" onClick=\"ContentSlider.turnpage(\''+sliderid+'\', '+i+'); return false\">'+thelinks[i]+'</a> '
    pcontent+='<a href="#" style="font-weight: bold;" onClick=\"ContentSlider.turnpage(\''+sliderid+'\', parseInt(this.getAttribute(\'rel\'))); return false\">Next</a>'
    The word 'Next' is hard coded (highlighted blue in the above). To change it, just change it.

    If that is all you need, fine. If you need more than one set of custom links per page, let me know.
    - John
    ________________________

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

  3. #3
    Join Date
    May 2006
    Posts
    266
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    hi just wondering is there anyway to tell this script to make sure that they have a < br /> between them?
    The web in one word.

  4. #4
    Join Date
    May 2006
    Posts
    266
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    don't worry i found out how.

    just add change the following. Please note this is after the update as been made. listed above
    Code:
    for (var i=0; i<slidernodes[sliderid].length; i++) //For each DIV within slider, generate a pagination link
    pcontent+='<a href="#" onClick=\"ContentSlider.turnpage(\''+sliderid+'\', '+i+'); return false\">'+thelinks[i]+'</a> '
    replace with
    Code:
    for (var i=0; i<slidernodes[sliderid].length; i++) //For each DIV within slider, generate a pagination link
    pcontent+='<br/><a href="#" onClick=\"ContentSlider.turnpage(\''+sliderid+'\', '+i+'); return false\">'+thelinks[i]+'</a> '
    The web in one word.

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
  •