Results 1 to 3 of 3

Thread: Ajaxtabs external div help

  1. #1
    Join Date
    Jul 2012
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Ajaxtabs external div help

    1) Script Title: Ajaxtabs

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

    3) Describe problem:
    I was trying to hide a div outside of the tabs with an onClick() event in the tab's link, but could not. Later, after some tinkering, i discovered that not even an in-line javascript alert would work with the onClick method. I'm fairly new to ajax implementation. The tabs are loaded as a search mechanism (included via php) site-wide, and on a particular page, i want to hide one of the divs on the page when one of the tabs are selected in particular. Is there no way to accomplish this?

    the initialization:
    Code:
    <script type="text/javascript">
    
    var searches=new ddajaxtabs("searchtabs", "searchcontainer")
    searches.setpersist(true)
    searches.setselectedClassTarget("link") //"link" or "linkparent"
    searches.init()
    
    </script>
    and the other portion of the ajaxtabs:
    Code:
    <ul id="searchtabs" class="shadetabs" style="text-align:left; width:700px; margin: 0px auto">
    <li><a href="<?=$site_url ?>example.php" rel="searchcontainer" class="selected">example</a></li>
    <li><a href="<?=$site_url ?>example2.php" rel="searchcontainer" id="nppa" onClick="document.getElementById('hide_this').style.display='none';">example 2</a></li>
    </ul>
    <div id="searchcontainer" style="border:1px solid gray; width:700px; margin: 0px auto; padding: 10px; background:#1003cb url(/i/searchbox.png) no-repeat; text-align:center; -moz-border-radius: 15px; border-radius: 15px">
    
    </div>
    ...

    elsewhere on the page:
    Code:
    <div id="hide_this">
    some content
    </div>
    Any way to make this work, or an alternative that may work for this?

    Thanks for any help.

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

    Default

    If you look at demo #2 on the script page, it actually shows two arbitrary DIVs on the page that are being toggled as you click on the tabs to their left. See this page for more info on how to set it up.
    DD Admin

  3. The Following User Says Thank You to ddadmin For This Useful Post:

    betterman2k12 (07-10-2012)

  4. #3
    Join Date
    Jul 2012
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I missed that when i was reading through, thank you for pointing it out

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
  •