Jquery slide picture switching effect code sharing, jquery slide

Source: Internet
Author: User

Jquery slide picture switching effect code sharing, jquery slide

This document describes how jquery performs slide picture switching. Share it with you for your reference. The details are as follows:
This is a jquery-based slide picture switching effect code with thumbnails and titles that can be customized.
Run: ------------------- view the download result source code -------------------

TIPS: If the browser cannot run properly, you can try to switch the browsing mode.
(1) Introduce CSS styles 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 slide picture switching code is as follows:

<Head> <title> slide picture switching effect </title> <LINK rel = stylesheet type = text/css href = "css/lrtk.css" charset = UTF-8 media = screen> <SCRIPT type = text/javascript src = "javascript/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 '). size () <= 1) {comment ('{pager'}.css ('display', 'None'); return;} var index = 0; var selected = null; var width = 756; $ ('# pager '). 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 '). get (index + 1); if (! A) a = $ ('# pager '). get (0); $ (). click (); return false;}); //]> </SCRIPT> 

The above is the jquery slide picture switching effect code shared for you. I hope you will like it and apply it to practice.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.