jquery show, trying to show element with the same class
I have several buttons .modif with an attribute title, diferent for each,
for example : title="box_one", then all the boxes have the same class
.box_slide, but I'm trying to show just the one who has also the class
box_one and hide the others, all the boxes had the class .box_slide
the thing is that all the boxes are hidding, can someone show me a better
way to do this.
$('.modif').click(function (){
var title = $(this).attr('title');
$('.box_slide').hide();
$('.box_' + title).show();
});
No comments:
Post a Comment