欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

jquery給圖片添加鼠標經過時的邊框效果

 更新時間:2013年11月12日 17:30:54   作者:  
鼠標經過時圖片產生塌陷,實則應該將邊框控制直接加在IMG標簽上即可,下面有個不錯的示例,大家可以感受下
一哥們兒要給圖片添加鼠標經過時的邊框效果,可惜出發(fā)點錯了,直接加在了IMG外的A標簽上致使 鼠標經過時圖片產生塌陷,實則應該將邊框控制直接加在IMG標簽上即可
錯誤代碼如下:注意紅色部分設置 (出發(fā)點就錯了)
復制代碼 代碼如下:

<html>
<head>
<script type="text/javascript" src="http://www.w3school.com.cn/jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#box a").mouseover(function(){
$(this).css("border","1px solid red");
});
$("#box a").mouseout(function(){
$(this).css("border","none");
});
});
</script>
<style>
#box a{ display:block; z-index:1000; width:98px; height:98px;}
</style>
</head>
<body>
<div id="box" style="width:100px; height:100px;">
<a href="#"><img src="erwm.png" border="0" width="99" height="99"/></a>
<a href="#"><img src="erwm.png" border="0" width="99" height="99"/></a>
</div>
</body>
</html>

修改后的正確設計思路:紅色部分為調整后的設置
復制代碼 代碼如下:

<html>
<head>
<script type="text/javascript" src="http://www.w3school.com.cn/jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#box img").mouseover(function(){
$(this).css("border","1px solid red");
});
$("#box img").mouseout(function(){
$(this).css("border","none");
});
});
</script>
<style>
#box a{ display:block; z-index:1000; width:98px; height:98px;}
</style>
</head>
<body>
<div id="box" style="width:100px; height:100px;">
<a href="#"><img src="erwm.png" border="0" width="99" height="99"/></a>
<a href="#"><img src="erwm.png" border="0" width="99" height="99"/></a>
</div>
</body>
</html>

相關文章

最新評論