SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist
    Join Date
    Aug 2010
    Posts
    503
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    jQuery Select Next Element

    Hi all, I'm trying to select the next element but it's not working. Please see my code below:

    Code HTML4Strict:
    <div id="content1" class="tabcontent" style="display:block;">
     
    <table style="width: 305px;" cellpadding="7" cellspacing="0">
        <tr class="even-row-light"><td><a class="accessoriesAdd" rel="1872">Add to Basket</a><div class="accsImg">
    <a href="/product/1872/hoya-standard-uv-77mm-filter/"><img src="/images/prod/No_Image.jpg" alt="Cannot find images!" width="60" style="border: solid #222 1px;" height="37" />
    </div>
    <div class="accsName">Hoya Standard UV 77mm Filter</div><br/><div class="accsPrice">&pound47.00</div></td></tr><tr class="odd-row"><td><a class="accessoriesAdd" rel="1887">Add to Basket</a><div class="accsImg">
     
    <a href="/product/1887/hoya-pro1-d-uv-77mm-filter/"><img src="/images/prod/No_Image.jpg" alt="Cannot find images!" width="60" style="border: solid #222 1px;" height="37" />
    </div>
    <div class="accsName">Hoya Pro1 D UV 77mm</div><br/><div class="accsPrice">&pound59.00</div></td></tr><tr class="even-row-light"><td><a class="accessoriesAdd" rel="1905">Add to Basket</a><div class="accsImg">
    <a href="/product/1905/hoya-standard-circular-polarizer-77mm-filter/"><img src="/images/prod/No_Image.jpg" alt="Cannot find images!" width="60" style="border: solid #222 1px;" height="37" />
    </div>
    <div class="accsName">Hoya Standard Circular Polarizer 77mm</div><br/><div class="accsPrice">&pound79.00</div></td></tr><tr class="odd-row"><td><a class="accessoriesAdd" rel="1915">Add to Basket</a><div class="accsImg">
    <a href="/product/1915/hoya-pro1-d-circular-polarizer-77mm-filter/"><img src="/images/prod/No_Image.jpg" alt="Cannot find images!" width="60" style="border: solid #222 1px;" height="37" />
    </div>
    <div class="accsName">Hoya Pro1 D Circular Polarizer</div><br/><div class="accsPrice">&pound132.00</div></td></tr><tr class="even-row-light"><td><a class="accessoriesAdd" rel="1895">Add to Basket</a><div class="accsImg">
    <a href="/product/1895/hoya-pro1-d-protector-77mm-filter/"><img src="/images/prod/No_Image.jpg" alt="Cannot find images!" width="60" style="border: solid #222 1px;" height="37" />
    </div>

    Code JavaScript:
        <script>
            jQuery(document).ready(function() {
     
               //jQuery('#content1 table tr td .accessoriesAdd').hide();
     
               jQuery('#content1 table tr td').mouseover(function(){
                   jQuery(this).next().css('display','none');
               }); 
            });
        </script>

    Any help would be really appreciated

  2. #2
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    You need to learn to debug things by yourself. You can tell there is a problem just from all the yellow synax highlighting. Your HTML is invalid because of the &pound; not being escaped properly.


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
  •