Home > Article > Web Front-end > jquery slideshow picture switching effect code sharing_jquery
The example in this article describes the slideshow image switching effect of jquery. Share it with everyone for your reference. The details are as follows:
This is a slideshow image switching effect code based on jquery, with thumbnails and titles, and the title can be customized.
Operation rendering: ------------------View the effect Download the source code---------- --------
Tips: If the browser does not work properly, you can try switching the browsing mode.
(1) Introduce CSS style in the head area:
<LINK rel=stylesheet type=text/css href="css/lrtk.css" charset=utf-8 media=screen>
(2) js code:
<SCRIPT type=text/javascript src="js/jquery-1.3.2.min.js"></SCRIPT> <SCRIPT type=text/javascript src="js/jquery.easing.1.2.js"></SCRIPT> <SCRIPT type=text/javascript> // <![CDATA[ $(document).ready(function(){ if ($('#pager a').size() <= 1) { $('#pager').css('display', 'none'); return; } var index = 0; var selected = null; var width = 756; $('#pager a').each(function(i){ if (i == 0) { selected = $(this); selected.find('img').attr('src', 'images/button- view-active.gif'); } $(this).click(function(){ index = i; selected.find('img').attr('src', 'images/button- view.gif'); selected = $(this); selected.find('img').attr('src', 'images/button- view-active.gif'); $('#images').animate({left:-(width * i)}, 500, 'easeOutQuad'); return false; }); }); $('#images').wrapInner('<a href="#" id="next"></a>'); $('#next').click(function(){ var a = $('#pager a').get(index + 1); if (!a) a = $('#pager a').get(0); $(a).click(); return false; }); }); // ]]> </SCRIPT>
The jquery slideshow picture switching effect code shared with you is as follows
幻灯片图片切换效果 <LINK rel=stylesheet type=text/css href="css/lrtk.css" charset=utf-8 media=screen> <SCRIPT type=text/javascript src="js/jquery-1.3.2.min.js"></SCRIPT> <SCRIPT type=text/javascript src="js/jquery.easing.1.2.js"></SCRIPT> <SCRIPT type=text/javascript> // <![CDATA[ $(document).ready(function(){ if ($('#pager a').size() <= 1) { $('#pager').css('display', 'none'); return; } var index = 0; var selected = null; var width = 756; $('#pager a').each(function(i){ if (i == 0) { selected = $(this); selected.find('img').attr('src', 'images/button- view-active.gif'); } $(this).click(function(){ index = i; selected.find('img').attr('src', 'images/button- view.gif'); selected = $(this); selected.find('img').attr('src', 'images/button- view-active.gif'); $('#images').animate({left:-(width * i)}, 500, 'easeOutQuad'); return false; }); }); $('#images').wrapInner('<a href="#" id="next"></a>'); $('#next').click(function(){ var a = $('#pager a').get(index + 1); if (!a) a = $('#pager a').get(0); $(a).click(); return false; }); }); // ]]> </SCRIPT>