html页面如下:
<div class="wrapper">
<div id="focus">
<ul>
<li><a href="http://www.lanrentuku.com/" target="_blank"><img src="img/01.jpg" alt="QQ商城焦点图效果下载" /></a></li>
<li><a href="http://www.lanrentuku.com/" target="_blank"><img src="img/02.jpg" alt="QQ商城焦点图效果教程" /></a></li>
<li><a href="http://www.lanrentuku.com/" target="_blank"><img src="img/03.jpg" alt="jquery商城焦点图效果" /></a></li>
<li><a href="http://www.lanrentuku.com/" target="_blank"><img src="img/04.jpg" alt="jquery商城焦点图代码" /></a></li>
<li><a href="http://www.lanrentuku.com/" target="_blank"><img src="img/05.jpg" alt="jquery商城焦点图源码" /></a></li>
</ul>
</div>
</div><!-- wrapper end -->
</body>
css样式:
<style type="text/css">
* {margin:0 padding:0}
body {font-size:12px color:#222 font-family:Verdana,Arial,Helvetica,sans-serif background:#f0f0f0}
.clearfix:after {content: "." display: block height: 0 clear: both visibility: hidden}
.clearfix {zoom:1}
ul,li {list-style:none}
img {border:0}
.wrapper {width:800px margin:0 auto padding-bottom:50px}
/* qqshop focus */
#focus {width:800px height:280px overflow:hidden position:relative}
#focus ul {height:380px position:absolute}
#focus ul li {float:left width:800px height:280px overflow:hidden position:relative background:#000}
#focus ul li div {position:absolute overflow:hidden}
#focus .btnBg {position:absolute width:800px height:20px left:0 bottom:0 background:#000}
#focus .btn {position:absolute width:780px height:10px padding:5px 10px right:0 bottom:0 text-align:right}
#focus .btn span {display:inline-block _display:inline _zoom:1 width:25px height:10px _font-size:0 margin-left:5px cursor:pointer background:#fff}
#focus .btn span.on {background:#fff}
#focus .preNext {width:45px height:100px position:absolute top:90px background:url(img/sprite.png) no-repeat 0 0 cursor:pointer}
#focus .pre {left:0}
#focus .next {right:0 background-position:right top}
</style>
首先我们先来编写一个HTML框架,如图所示;2
/7
如图,我们来创建一个a标签,进行超链接的展示;
3
/7
我们接下来书写head书签,在其中进行书写其他编写;
4
/7
接着书写style标签,在其中书写css代码;
5
/7
我们利用a:link 进行对未点击的超链接进行样式设置;
6
/7
接着利用a:visited进行对已点击的超链接进行设置;
7
/7
最后,我们还可以对鼠标悬停的状态进行样式修改,如图代码 a:hover;
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/htmlcharset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
function A(){
alert("被点击了")
}
</script>
</head>
<body>
<a href="#" onclick=A()>Addfdsfd</a>
</body>
</html>
这样就可以了
把window.onload=function(){}去掉就有效果了