Jump to content

pclipwd

Members
  • Posts

    3
  • Joined

  • Last visited

pclipwd's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Thanks, it works perfectly!
  2. Thanks for your response!What if I'd like to select another child of the grandparent of the current item? <div class="views-row views-row-1 views-row-odd views-row-first"> <div class="views-field views-field-field-inleiding"> <div class="field-content"> <a title="Lees meer..." href="#" class="readmore">Read more...</a> </div> </div> <div class="views-field views-field-body" style="display: none;"> <div class="field-content">CONTENT</div> </div></div> So let's say the current item is <a title="Lees meer..." href="#" class="readmore">Read more...</a> and I would like to select <div class="views-field views-field-body" style="display: none;"> I managed to select the parent item <div class="views-row views-row-1 views-row-odd views-row-first"> using the following snippet: $("#block-views-eriks-diary-block-1 .readmore").click(function(){ $(this).parent().parent().parent().slideToggle("slow");}); But how can I select a child item?
  3. I'm using the following jQuery function: $(document).ready(function(){$("#block-views-eriks-diary-block-1 .views-field-body").hide();$(".views-row-1 .readmore").toggle(function(){ $(this).addClass("expanded"); }, function () { $(this).removeClass("expanded");});$(".readmore").click(function(){ $("#block-views-eriks-diary-block-1 .views-row-1 .views-field-body").slideToggle("slow");});}); Is there any way to change this function so that .views-row-# can vary from 1 to 9 without having to add multiple versions of this snippet with .views-row-1, .views-row-2, etc.?I'm pretty new to jQuery so I'm not familiar with all the ins and outs yet... Any help would be appreciated!
×
×
  • Create New...