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

jquery給圖片添加鼠標(biāo)經(jīng)過時(shí)的邊框效果

 更新時(shí)間:2013年11月12日 17:30:54   作者:  
鼠標(biāo)經(jīng)過時(shí)圖片產(chǎn)生塌陷,實(shí)則應(yīng)該將邊框控制直接加在IMG標(biāo)簽上即可,下面有個(gè)不錯(cuò)的示例,大家可以感受下
一哥們兒要給圖片添加鼠標(biāo)經(jīng)過時(shí)的邊框效果,可惜出發(fā)點(diǎn)錯(cuò)了,直接加在了IMG外的A標(biāo)簽上致使 鼠標(biāo)經(jīng)過時(shí)圖片產(chǎn)生塌陷,實(shí)則應(yīng)該將邊框控制直接加在IMG標(biāo)簽上即可
錯(cuò)誤代碼如下:注意紅色部分設(shè)置 (出發(fā)點(diǎn)就錯(cuò)了)
復(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>

修改后的正確設(shè)計(jì)思路:紅色部分為調(diào)整后的設(shè)置
復(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 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>

相關(guān)文章

最新評(píng)論