js模仿hover的具體實現(xiàn)代碼
更新時間:2013年12月30日 16:58:22 作者:
hover效果,想必大家并不陌生吧,接下來為大家介紹下使用js模仿hover,感興趣的朋友可以參考下
復制代碼 代碼如下:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="description" content="this" />
<meta name="keywords" content="this" />
<title>this</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<style type="text/css">
body{margin:0;padding:0;}
.hover{float:left;position:relative;margin:0 auto;padding:0; }
.hv{position:absolute; left:0;top:0;display:none; }
</style>
<script type="text/javascript">
$(function() {
$('.hover').hover(
function (){
$('.hv').stop().fadeTo('slow',1);
},function() {
$('.hv').stop().fadeTo('slow',0);
}
)
})
</script>
</head>
<body>
<div class="hover">
<img src="http://img.vip.xunlei.com/img/banner/201303181424386268.jpg" alt="" width='100px' height='100px'>
<img class="hv" src="http://www.baidu.com/img/shouye_b5486898c692066bd2cbaeda86d74448.gif" alt="" width='100px' height='100px'>
</div>
</body>
</html>
相關(guān)文章
BootStrap Fileinput插件和Bootstrap table表格插件相結(jié)合實現(xiàn)文件上傳、預覽、提交的導入E
這篇文章主要介紹了BootStrap Fileinput插件和Bootstrap table表格插件相結(jié)合實現(xiàn)文件上傳、預覽、提交的導入Excel數(shù)據(jù)操作步驟,需要的朋友可以參考下2017-08-08javascript開發(fā)隨筆一 preventDefault的必要
給a做按鈕的click事件加preventDefault阻止瀏覽器的默認行為貌似是印象中必須的事情2011-11-11JavaScript 字符串處理函數(shù)使用小結(jié)
JavaScript 字符串處理函數(shù)使用小結(jié),學習js的朋友可以參考下。2010-12-12