读书人

大神们 哪位高手知道如何设置 鼠标停留

发布时间: 2013-11-08 17:52:14 作者: rapoo

大神们 谁知道怎么设置 鼠标停留时 图片放大这个事件啊
我做了一个类似于windows8系统界面的 然后向写一个 当鼠标移到图片上自动放大 鼠标离开后 变回去的效果
,在网上中了教程 不过,没怎么看懂说是要添加一个事件,就是这个网址http://jingyan.baidu.com/article/ae97a646894b8dbbfd461dfd.html
不过我就一直没有找到+这个按钮 , 所以就一直 没做出来 ,求大神指导啊
[解决办法]
给图片加mouseover 和mouseout事件 试试
[解决办法]


<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="Scripts/jquery-1.7.1.min.js"></script>
</head>
<body>
<div>
<img id="pic" src="sample.jpg" width="500" height="400" />
</div>
<script>
$("#pic").mouseover(function () {
$(this).width(600);
$(this).height(500);
}).mouseout(function () {
$(this).width(500);
$(this).height(400);
});
</script>
</body>
</html>


[解决办法]
引用:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="Scripts/jquery-1.7.1.min.js"></script>
</head>
<body>
<div>
<img id="pic" src="sample.jpg" width="500" height="400" />
</div>
<script>
$("#pic").mouseover(function () {
$(this).width(600);
$(this).height(500);
}).mouseout(function () {
$(this).width(500);
$(this).height(400);
});
</script>
</body>
</html>


这个应该可以实现吧。
[解决办法]
引用:
Quote: 引用:

Quote: 引用:


<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="Scripts/jquery-1.7.1.min.js"></script>
</head>
<body>
<div>
<img id="pic" src="sample.jpg" width="500" height="400" />
</div>
<script>
$("#pic").mouseover(function () {
$(this).width(600);
$(this).height(500);
}).mouseout(function () {
$(this).width(500);
$(this).height(400);
});
</script>
</body>
</html>


这个应该可以实现吧。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script src="jquery-1.7.1.min.js"></script>
</head>

<body>
<div>
<img id="img1" src="2c2e982be5e17beb4c00d759393e7d7d.jpg" width="500" height="400" />
</div>
<script>
$("#img1").mouseover(function(){
$(this).width(1024);
$(this).height(768);
}).mouseout(function(){
$(this).width(500);
$(this).height(400)
})
</script>
</body>
</html>

这是我写的 应该和您定的一样但是 为什么 没有效果呢



你确定你的脚本路径对了吗?我再我电脑上面用你的代码是可以的。

读书人网 >CSS

热点推荐