jQuery¼¼Êõ

jQuery bannerͼƬÂÖ²¥ÊµÀý´úÂë´óÈ«½éÉÜ

×ÖºÅ+ ×÷ÕߣºH5Ö®¼Ò À´Ô´£ºH5Ö®¼Ò 2016-03-16 14:00 ÎÒÒªÆÀÂÛ( )

ÅóÓѸøÎÒ¿´ÁËÒ»¸öÂÖ²¥Ð§¹û£¬°ÑjsÏÂÔØÒ»¿´£¬Ñ¾Ñ¾µÄÒ»¸öÕâô¼òµ¥µÄЧ¹û£¬ÕâôµÄ¾ÍÄÜд¸ö¼¸°ÙÐеģ¬ÑÏÖØÓ°Ïìä¯ÀÀÆ÷¼ÓÔØËÙ¶ÈÂÒÔΪÈ˼ҿí´øÁ÷Á¿²»ÒªÇ®ÍæµÄŶ¡£¡£ÎÞ

ÅóÓѸøÎÒ¿´ÁËÒ»¸öÂÖ²¥Ð§¹û£¬°ÑjsÏÂÔØÒ»¿´£¬Ñ¾Ñ¾µÄÒ»¸öÕâô¼òµ¥µÄЧ¹û£¬ÕâôµÄ¾ÍÄÜд¸ö¼¸°ÙÐеģ¬ÑÏÖØÓ°Ïìä¯ÀÀÆ÷¼ÓÔØËÙ¶ÈÂÒÔΪÈ˼ҿí´øÁ÷Á¿²»ÒªÇ®ÍæµÄŶ¡£¡£ÎÞÄÎ֮ϸøËûдÁ˸ö¼òµ¥µÄ£¬°ÑËùÓдúÂë·ÅÉÏÈ¥¶¼Ã»Óг¬¹ý70ÐУ¬»¹ÓÐÔ²½ÇµÄÄǸöCSS£¬²»ÊÇÿ¸öä¯ÀÀÆ÷¶¼ÊÇÔ²½ÇµÄ£¬²»¹ý²»Ó°ÏìÃÀ¹Û£¬ÎûÎû¡£
Ïȸø´ó¼ÒչʾÏÂЧ¹ûͼ£º


 xmlns="" >
ÎÞ±êÌâÒ³
 src="js/jquery-2.1.4.js" type="text/javascript">
 type="text/css">
.clear{overflow:hidden; clear:both; width:0px; height:0px; }
.imgbox{width:640px; margin:0 auto; text-align:center; }
ul{padding:0px; margin:0px;}
ul li{float:left; list-style:none; }
ul li.select{display:block;}
.imgnum span{border-radius:10px; font:normal normal bold 12px/15px ΢ÈíÑźÚ; color:#FFF; margin-left:5px; padding:3px 6px 3px 6px; background-color:#F90; cursor:pointer;}
.imgnum span.onselect{background-color:#F00;}
.imgnum{text-align:center; float:right; margin:-30px 30px; position:relative;}
 class="imgbox">
 id="banner_img">
 src="images/banner1.jpg"/>
 src="images/banner2.jpg"/>
 src="images/banner3.jpg"/>
 src="images/banner4.jpg"/>
 src="images/banner5.jpg"/>
 class="clear">
 class="imgnum">
 class="onselect">1
2
3
4
5
 type="text/javascript">
var time = "";
var index = 1;
$(function () {
showimg(index);
//Êó±êÒÆÈëÒƳö
$(".imgnum span").hover(function () {
clearTimeout(time);
var icon=$(this).text();
$(".imgnum span").removeClass("onselect").eq(icon-1).addClass("onselect");
$("#banner_img li").hide().stop(true,true).eq(icon-1).fadeIn("slow");
}, function () {
index=$(this).text()> 4 ? 1 :parseInt($(this).text())+1;
time = setTimeout("showimg(" + index + ")", 3000);
});
});
function showimg(num) {
index = num;
$(".imgnum span").removeClass("onselect").eq(index-1).addClass("onselect");
$("#banner_img li").hide().stop(true,true).eq(index-1).fadeIn("slow");
index = index + 1 > 5 ? 1 : index + 1;
time = setTimeout("showimg(" + index + ")", 3000);
}
 
 

¡¾ÉùÃ÷¡¿:ºÚ°É°²È«Íø()µÇÔØ´ËÎijöÓÚ´«µÝ¸ü¶àÐÅϢ֮ĿµÄ£¬²¢²»´ú±í±¾Õ¾ÔÞͬÆä¹ÛµãºÍ¶ÔÆäÕæʵÐÔ¸ºÔ𣬽öÊÊÓÚÍøÂ簲ȫ¼¼Êõ°®ºÃÕßѧϰÑо¿Ê¹Óã¬Ñ§Ï°ÖÐÇë×ñÑ­¹ú¼ÒÏà¹Ø·¨ÂÉ·¨¹æ¡£ÈçÓÐÎÊÌâÇëÁªÏµÎÒÃÇ£¬ÁªÏµÓÊÏäadmin@myhack58.com£¬ÎÒÃÇ»áÔÚ×î¶ÌµÄʱ¼äÄÚ½øÐд¦Àí¡£

¡¡

1.±¾Õ¾×ñÑ­ÐÐÒµ¹æ·¶£¬ÈκÎתÔصĸå¼þ¶¼»áÃ÷È·±ê×¢×÷ÕߺÍÀ´Ô´£»2.±¾Õ¾µÄÔ­´´ÎÄÕ£¬ÇëתÔØʱÎñ±Ø×¢Ã÷ÎÄÕÂ×÷ÕߺÍÀ´Ô´£¬²»×ðÖØÔ­´´µÄÐÐΪÎÒÃǽ«×·¾¿ÔðÈΣ»3.×÷ÕßͶ¸å¿ÉÄܻᾭÎÒÃDZ༭Ð޸Ļò²¹³ä¡£

Ïà¹ØÎÄÕÂ
  • ÿ¸ö³ÌÐòÔ±¶¼»áµÄ 35 ¸ö jQuery С¼¼ÇÉ ÂëÅ©Íø

    ÿ¸ö³ÌÐòÔ±¶¼»áµÄ 35 ¸ö jQuery С¼¼ÇÉ ÂëÅ©Íø

    2016-01-16 16:02

  • ¡¶jQuery»ù´¡½Ì³Ì¡·ÖÐÎÄPDF°æ

    ¡¶jQuery»ù´¡½Ì³Ì¡·ÖÐÎÄPDF°æ

    2015-10-31 15:24

  • ¡¶JQueryʵսÊÓƵ½Ì³Ì¡·AVI

    ¡¶JQueryʵսÊÓƵ½Ì³Ì¡·AVI

    2015-10-03 15:08

ÍøÓѵãÆÀ
¬