大神们 谁知道怎么设置 鼠标停留时 图片放大这个事件啊

好人田 2013-08-28 11:22:23
我做了一个类似于windows8系统界面的 然后向写一个 当鼠标移到图片上自动放大 鼠标离开后 变回去的效果
,在网上中了教程 不过,没怎么看懂说是要添加一个事件,就是这个网址http://jingyan.baidu.com/article/ae97a646894b8dbbfd461dfd.html
不过我就一直没有找到+这个按钮 , 所以就一直 没做出来 ,求大神指导啊
...全文
375 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
lu在脚下 2014-08-05
  • 打赏
  • 举报
回复
我也没用
可乐波波 2013-08-29
  • 打赏
  • 举报
回复
引用 7 楼 jun881220 的回复:
[quote=引用 5 楼 lazio2007 的回复:] [quote=引用 4 楼 lazio2007 的回复:]

<!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]
<!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>
这是我写的 应该和您定的一样但是 为什么 没有效果呢[/quote] 你确定你的脚本路径对了吗?我再我电脑上面用你的代码是可以的。
好人田 2013-08-28
  • 打赏
  • 举报
回复
引用 5 楼 lazio2007 的回复:
[quote=引用 4 楼 lazio2007 的回复:]

<!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]
<!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>
这是我写的 应该和您定的一样但是 为什么 没有效果呢
好人田 2013-08-28
  • 打赏
  • 举报
回复
引用 1 楼 zzgzzg00 的回复:
给图片加mouseover 和mouseout事件 试试
恩 我刚刚在群里 也是这么说的 不过求一个详细点的 源码
好人田 2013-08-28
  • 打赏
  • 举报
回复
求指导啊啊啊啊啊啊啊啊啊啊啊啊啊
似梦飞花 2013-08-28
  • 打赏
  • 举报
回复
给图片加mouseover 和mouseout事件 试试
好人田 2013-08-28
  • 打赏
  • 举报
回复
引用 5 楼 lazio2007 的回复:
[quote=引用 4 楼 lazio2007 的回复:]

<!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]恩 我试试
可乐波波 2013-08-28
  • 打赏
  • 举报
回复
引用 4 楼 lazio2007 的回复:

<!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>

这个应该可以实现吧。
可乐波波 2013-08-28
  • 打赏
  • 举报
回复

<!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>

61,111

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧