Results 1 to 2 of 2

Thread: Tab Content Script (v 2.2) more than once on a page

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

    Default Tab Content Script (v 2.2) more than once on a page

    1) Script Title: Tab Content Script (v 2.2) more than once on a page

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

    3) Describe problem:
    Hi i want to use the tab content script for describing items.
    My problem is i want to put the tab content 10 times on one page .
    Because i got 10 items per page .
    It is working if i put just one on my site .
    But if i put more than one the others wont work.
    U can see all 10 tab content scripts but 9 of them doesnt show the content (Describing part) and u cant click on the tabs that they switch from tab1 to tab2.

    What do i have to change?????

    I have got here all files what u need. Just download it.
    In there are 2 .html the first index.html is just one Tab content script in it
    and the second is indexproblem.html there are 5 tab contents in it 4 of them doesnt work u see them only thy dont show the content.
    Here

    Thanks

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

    Default

    The script does support multiple instances on the same page, though you need to make sure each instance contains its own unique IDs for the concerned HTML elements, plus unique variable names when initializing each instance. In other words, the code in red needs to be unique for each instance:

    Code:
    var countries=new ddtabcontent("countrytabs")
    countries.setpersist(true)
    countries.setselectedClassTarget("link") //"link" or "linkparent"
    countries.init()
    DD Admin

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
  •