一个自动获取图片焦点,并定时切换的代码:
此图镇楼:
1.html代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>JS焦点幻灯代码 </title>
<script type="text/javascript" src="js/js1.js"></script>
<link rel="stylesheet" href="css/base.css" />
<style type="text/css">
#ifocus { width:500px; height:266px;margin:0 auto;border:1px solid #DEDEDE; background:#F8F8F8; }
#ifocus_pic { display:inline; position:relative; float:left; width:400px; height:266px; overflow:hidden; }
#ifocus_piclist { position:absolute; }
#ifocus_piclist li { width:400px; height:266px; overflow:hidden; }
#ifocus_piclist img { width:400px; height:266px; margin: 0 auto;}
#ifocus_btn { display:inline; float:left; width:99px;margin-right:1px ;}
#ifocus_btn li { width:98px; height:53px; cursor:pointer; opacity:0.5; -moz-opacity:0.5; filter:alpha(opacity=50); }
#ifocus_btn img { width:98px