Results 1 to 2 of 2

Thread: Javascript with Tab Content

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

    Default Javascript with Tab Content

    I am using Tab Content script v2.2. I need to execute a very small Javascript function when a specific tab is clicked. I have tried the following without success (the script is not executed):

    [CODE]
    <ul id="flowertabs" class="shadetabs">
    <li><a href="#" rel="tcontent1" class="selected">Description</a></li>
    <li><a href="#" rel="tcontent2">Specifications</a></li>
    <li><a href="#" rel="tcontent3">Includes</a></li>
    <li><a href="#" rel="tcontent4" onClick="startMagnify()">Images/Video</a></li>
    </ul>
    [CODE]

    Below is the Javascript function

    [CODE]
    <script type="text/javascript">
    function startMagnify()
    {
    alert("magic start");
    MagicMagnifyPlus.start();
    }
    </script>
    [CODE]

    Any help will be very much appreciated. YES, I am a novice.

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

    Default

    Warning: Please include a link to the DD script in question in your post, in this case, http://www.dynamicdrive.com/dynamici...tabcontent.htm . See this thread for the proper posting format when asking a question.

    Simply move the onClick event handler from inside the <a> element to its parent <li> instead:

    Code:
    <ul id="flowertabs" class="shadetabs">
    <li><a href="#" rel="tcontent1" class="selected">Description</a></li>
    <li><a href="#" rel="tcontent2">Specifications</a></li>
    <li><a href="#" rel="tcontent3">Includes</a></li>
    <li onClick="startMagnify()"><a href="#" rel="tcontent4">Images/Video</a></li>
    </ul>
    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
  •