<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" src="http://www.sz886.com/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function(e) {
$.each($("#PagingView a"),function(index,item){
switch($(item).text()){
case "First":
$(item).css({"color":"#ff0","background":"url(logo.png)"})
break
case "Next":
$(item).css({"color":"#f00","background":"url(logo.png)"})
break
case "Last":
$(item).css({"color":"#0f0","background":"url(logo.png)"})
break
}
})
})
</script>
</head>
<body>
<div id="PagingView" style="width:500pxheight:500px">
<a href="javascript:" style="height:100pxwidth:100pxdisplay:block">First</a>
<a href="javascript:" style="height:100pxwidth:100pxdisplay:block">Next</a>
<a href="javascript:" style="height:100pxwidth:100pxdisplay:block">Last</a>
</div>
</body>
</html>
你是不是要在a标签里面超链接样式a:hover加上背景图片啊?如果是这样 那你要写hover你要写CSS样式!<style type=text/css>a:hover{background-image:url("图片地址")}</style><a href="#">网站开始的动图</a>,只要把a链接包含住图就行,另外还有一种方法就是在图片上的代码加上onclick,然后加上js跳转页面.你可以试试看.关键是能学到知识.欢迎分享,转载请注明来源:内存溢出
评论列表(0条)