jquery图片滚动放大代码分享(1)

2020-05-29 07:04:04易采站长站整理

}

$('#btn-right').click(function() {
if ($slider_child_l < 6 || slider_count >= $slider_child_l - 6) {
return false;
}

slider_count++;
$slider.animate({left: '-=' + $slider_width + 'px'}, 'slow');
slider_pic();
});

$('#btn-left').click(function() {
if (slider_count <= 0) {
return false;
}

slider_count--;
$slider.animate({left: '+=' + $slider_width + 'px'}, 'slow');
slider_pic();
});

function slider_pic() {
if (slider_count >= $slider_child_l - 6) {
$('#btn-right').css({cursor: 'auto'});
$('#btn-right').addClass("dasabled");
}
else if (slider_count > 0 && slider_count <= $slider_child_l - 6) {
$('#btn-left').css({cursor: 'pointer'});
$('#btn-left').removeClass("dasabled");
$('#btn-right').css({cursor: 'pointer'});
$('#btn-right').removeClass("dasabled");
}
else if (slider_count <= 0) {
$('#btn-left').css({cursor: 'auto'});
$('#btn-left').addClass("dasabled");
}
}

$('.slider a').hover(function() {
if ($(this).find('img:animated').length) return;
$(this).animate({marginTop: '0px'}, 300);
$(this).find('img').animate({width: '150px'}, 300);
}, function() {

$(this).animate({marginTop: '24px'}, 200);
$(this).find('img').animate({width: '90px'}, 200);
});

</script>
<div style="text-align:center;clear:both">
</div>
</body>
</html>

以上就是为大家分享的jquery图片滚动放大效果代码,希望大家可以喜欢。