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
    Somewhere behind your screen
    Posts
    1,648
    try to look for a problem in the other document parts
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

  3. #3
    Join Date
    Feb 2011
    Posts
    231
    Hi,
    Try use Mozilla Firefox with Firebug addon, it can show the errors in javascript script in the page.

  4. #4
    Join Date
    Sep 2007
    Posts
    315
    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.
    Bismillahirrahmanirrahîm
    Hamd, Âlemlerin Rabbi, Rahmân, Rahîm, hesap ve ceza gününün (ahiret gününün) maliki Allah'a mahsustur. (Allahım!) Yalnız sana ibadet ederiz ve yalnız senden yardım dileriz. Bizi doğru yola, kendilerine nimet verdiklerinin yoluna ilet; gazaba uğrayanların ve sapıklarınkine değil.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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