特效描述:利用CSS实现幻灯片图片切换特效,利用CSS实现幻灯片图片切换特效
代码结构
1. HTML代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="keywords" content=" " />
<meta name="description" content=" " />
<title></title>
<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>
</head>
<body style="text-align:center" class=work-project>
<DIV id=content>
<DIV id=project><!– project navigation –>
<P id=navigation><SPAN id=pager>
<A href="images/1.jpg"><IMG alt=1 src="images/button-view.gif" width=12 height=19></A>
<A href="images/2.jpg"><IMG alt=2 src="images/button-view.gif" width=12 height=19></A>
<A href="images/3.jpg"><IMG alt=3 src="images/button-view.gif" width=12 height=19></A>
<A href="images/4.jpg"><IMG alt=4 src="images/button-view.gif" width=12 height=19></A>
<A href="images/5.jpg"><IMG alt=5 src="images/button-view.gif" width=12 height=19></A>
</SPAN></P>
<!– project images –>
<DIV id=mask>
<DIV id=images>
<IMG src="images/1.jpg" width=756 height=518><IMG src="images/2.jpg" width=756 height=518><IMG src="images/3.jpg" width=756 height=518><IMG src="images/4.jpg" width=756 height=518><IMG src="images/5.jpg" width=756 height=518></DIV></DIV><!– project title –>
</DIV></DIV>
</DIV>
</body>
</html>
下载地址
1.《js焦点图特效 幻灯片图片切换特效代码》援引自互联网,旨在传递更多网络信息知识,仅代表作者本人观点,与本网站无关,侵删请联系页脚下方联系方式。
2.《js焦点图特效 幻灯片图片切换特效代码》仅供读者参考,本网站未对该内容进行证实,对其原创性、真实性、完整性、及时性不作任何保证。
3.文章转载时请保留本站内容来源地址,https://www.cxvn.com/code/focus/388.html