Results 1 to 5 of 5

Thread: changes to the Multi-part content script

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

    Default changes to the Multi-part content script

    Script: DD Multi-part content script
    http://www.dynamicdrive.com/dynamici...artcontent.htm

    Hi!

    Looked through the board but did not see this: How can I change the Multi-part content script so below I don't have a "forward" and "back" button but "content1", "content2", "content3" and so on?
    Can anyone help?

    Thanks,
    Chris
    Last edited by bahia; 05-04-2006 at 05:10 PM.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Warning: Please include a link to the DD script in question in your post. See this thread for the proper posting format for asking a question.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Have a new function:
    Code:
    function cycleto(/*int*/ num){
    partscollect[curpart].style.display="none"
    curpart=num;
    partscollect[curpart].style.display="block"
    updatenav()
    }
    And edit updatenav():
    Code:
    function updatenav(){
    document.getElementById("backbutton").style.visibility=(curpart==0)? "hidden" : "visible"
    document.getElementById("forwardbutton").style.visibility=(curpart==partscollect.length-1)? "hidden" : "visible"
    for(var i=0;document.getElementById("tobutton" + i);i++) document.getElementById("tobutton" + i).style.visibility == (i==curpart ? "hidden" : "visible");
    }
    Then:
    Code:
    <a href="javascript:cycleto(0);" id="tobutton0">Go to first part</a>
    <a href="javascript:cycleto(1);" id="tobutton1">Go to second part</a>
    <a href="javascript:cycleto(2);" id="tobutton2">Go to third part</a>
    <!-- ... etc ... -->
    Wrap the forward and back buttons in <div style="display:none;"> if you don't want them.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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

    Default

    this is JUST GREAT!
    Works perfect!
    Thanks a lot, Twey!

    Chris

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
  •