How to realize the js special effects of common photo albums by clicking on the left and right side of the photo album and switching between them?
This article mainly explains the "commonly used photo album pictures around click to switch rotation js special effects how to achieve", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "common photo album pictures around click to switch rotation js special effects how to achieve" it!
Click on the left and right side of commonly used photo albums to switch the js special effects of roulette.
$(document) .ready (function () {
/ / Click the small image to switch to the larger image.
$("# thumbnail li a") .click (function () {
$(".zoompic img") .hide () .attr ({"src": $(this) .attr ("href"), "title": $("> img", this) .attr ("title")})
$("# thumbnail li.current") .removeClass ("current")
$(this) .salary ("li") .addClass ("current")
Return false
});
$(".zoompic > img") .load (function () {
$(".zoompic > img:hidden") .show ()
});
/ / Scroll the small picture left and right
Var $slider = $('.slider ul')
Var $slider_child_l = $('.slider ul li') .length
Var $slider_width = $('.slider ul li') .width ()
$slider.width ($slider_child_l * $slider_width)
Var slider_count = 0
If ($slider_child_l
< 5) { $('#btn-right').css({cursor: 'auto'}); $('#btn-right').removeClass("dasabled"); } $('#btn-right').click(function() { if ($slider_child_l < 5 || slider_count >= $slider_child_l-5) {
Return false
}
Slider_count++
$slider.animate ({left:'- ='+ $slider_width + 'px'},' fast')
Slider_pic ()
});
$('# btn-left') .click (function () {
If (slider_count = $slider_child_l-5) {
('# btn-right') .css ({cursor: 'auto'})
$('# btn-right') .addClass ("dasabled")
}
Else if (slider_count > 0 & & slider_count
Thank you for your reading, the above is the "commonly used photo album pictures around click to switch round broadcast js special effects how to achieve" content, after the study of this article, I believe you on the common photo album pictures around click to switch rotation js special effects how to achieve this problem has a deeper understanding, the specific use of the need for you to practice and verify. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!