DotDragnet
May 24, 2012, 04:59:47 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Mobile users - Our forum is Tapatalk enabled. http://www.tapatalk.com/
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: jQuery hide show  (Read 215 times)
SLEE
Hero Member
*****
Posts: 824



View Profile WWW Awards
« on: June 09, 2011, 04:49:53 PM »

I need to be able to filter some divs.
I would like to be able to click a link and use the links value to decide which divs should show and then hide the others.
So far I've got the following but it is not working:
Code:
$('.catLink').click(function() {

var filterCat = $(this).val();

  $('.single_product_display').each(function(index) {
$(this).not('div[class="'+filterName+'"]"').hide();
  });
 
});

This code successfully hide them all:
Code:
$('.catLink').click(function() {

var filterCat = $(this).val();

  $('.single_product_display').each(function(index) {
$(this).hide();
  });

});

I just need to figure out how to pass in the links value and use that to show those by the class name.

can anyone help?

Logged

SLEE - still the most confusing ddner...

Follow me on Twitter
SLEE
Hero Member
*****
Posts: 824



View Profile WWW Awards
« Reply #1 on: June 09, 2011, 05:49:43 PM »

Figured it out: http://net.tutsplus.com/tutorials/javascript-ajax/creating-a-filterable-portfolio-with-jquery/
Logged

SLEE - still the most confusing ddner...

Follow me on Twitter
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2006-2008, Simple Machines Valid XHTML 1.0! Valid CSS!