In this example http://jsbin.com/avewul/2/ i use the rcarousel jQuery plugin which slides elements
the idea is to change content of the black title below by the id attribute value of the hovered slide element. that’s just work for the first one.
if you remove the the $(document).ready event everything will be ok. but i need it inside the $(document).ready event
javascript:
$(document).ready(function($) {
var J_text = $(".change").text();
$(".slide").hover(function(){
var J_id = $(this).attr("id");
$(".change").text(J_id);
}, function(){
$(".change").text(J_text);
});
});
Using this should work:
It delegates the mouseenter and mouseleave event of the slides to the body element. This way the event is also executed for dynamically added elements