www.webdeveloper.com
Results 1 to 4 of 4

Thread: JQuery Hide

  1. #1
    Join Date
    Aug 2011
    Posts
    7

    JQuery Hide

    This should be so simple... but as you can guess im pretty new to this!

    HTML Code:
    <table>
    <tbody>
    <tr>
    <td><img alt="Voyager Product" src="/files/img/products/voyager_tn.jpg" /></td>
    </tr>
    <tr>
    <td onclick="$('#voyagerinformation').hide();" style="text-align: center;">Voyager</td>
    </tr>
    </tbody>
    </table>
    
    <div style="border: 1px solid;" id="voyagerinformation">
    <strong>Information on the Voyager</strong>
    <br>
    blah blah blah blah blah blah blah
    <br>
    Click Here For More Info
    </div>

    What is wrong with this code?? the DIV doesnt hide when the text within the TD is clicked. JQuery 1.7.1 defined in the document head.

  2. #2
    Join Date
    May 2006
    Location
    Russia, Rostov-on-Don
    Posts
    1,237
    try to look for a problem in the other document parts
    use [code]YOUR CODE GOES HERE[/code] or burn in Hell

  3. #3
    Join Date
    Feb 2011
    Posts
    225
    Hi,
    Try use Mozilla Firefox with Firebug addon, it can show the errors in javascript script in the page.
    Free resources, Courses and Tutorials for Web Programmers

  4. #4
    Join Date
    Sep 2007
    Posts
    284
    Your code is working.
    Code:
      
    <html>
    <head>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"></script>
    </head>
    <body>
    
    <table>
    <tbody>
    <tr>
    <td><img alt="Voyager Product" src="http://1.bp.blogspot.com/-0uMqDbh6pHs/T2w8qwDVjmI/AAAAAAAABag/0gMPqdrHFGQ/s320/istanbul_manzara10.jpg" /></td>
    </tr>
    <tr>
    <td onclick="$('#voyagerinformation').hide();" style="text-align: center;">Voyager</td>
    </tr>
    </tbody>
    </table>
    
    <div style="border: 1px solid;" id="voyagerinformation">
    <strong>Information on the Voyager</strong>
    <br>
    blah blah blah blah blah blah blah
    <br>
    Click Here For More Info
    </div>
    </body>
    </html>
    This code is working in Firefox 4.0b9 and Konqueror 4.5.5
    Last edited by Ayşe; 06-09-2012 at 04:46 PM.
    The Time Through Ages
    In the Name of Allah, Most Gracious, Most Merciful
    1. By the Time,
    2. Verily Man is in loss,
    3. Except such as have Faith, and do righteous deeds, and (join together) in the mutual enjoining of Truth, and of Patience and Constancy.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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
  •  
HTML5 Development Center



Recent Articles