views:

39

answers:

1

problem with parent()

jQuery Code http://webdev.faressoft.org/wp-content/plugins/ImageSlideShow/js/slideShow.js

You can see the result here (Image Slide Show) http://webdev.faressoft.org/?p=208

$(".ImageNum span").click(function() {
var image = parseInt($(this).text());
$(".correntImage", $(this).parent()).removeClass("correntImage");
$(this).addClass("correntImage");
$(this).parent().parent().children("img").css("display","none");
$(this).parent().parent().children("img").slice(image-1,image).css("display","block");
$(this).parent().parent().children(".autoSlideShow").text("false");
});

why nothing change when i click on $(".ImageNum span") ?

+3  A: 

I think the problem could be the use of children() more than the use of parent().

$(this).parent().parent() has not direct <img> children... has it ?

Try replacing children() by find() ;)

Golmote
thank you very much.
faressoft