周五散分啦

daf380 2011-07-08 04:12:04
求大侠指点
做网页 怎么让吧鼠标放在图片上 他自己 会变大,移开后就变会原来大小, 求JavaScript软件代码?。。
...全文
307 28 打赏 收藏 转发到动态 举报
写回复
用AI写文章
28 条回复
切换为时间正序
请发表友善的回复…
发表回复
ebonyzhang 2011-07-15
  • 打赏
  • 举报
回复
nafen
smell_up 2011-07-15
  • 打赏
  • 举报
回复
可以接受
koo42636880 2011-07-15
  • 打赏
  • 举报
回复
我接个分...该说的楼上都说了!
ghost123cc 2011-07-15
  • 打赏
  • 举报
回复
已经解决
MadEric 2011-07-12
  • 打赏
  • 举报
回复
3楼正解
balenofun 2011-07-12
  • 打赏
  • 举报
回复
JF。。。。。。。。。。。
confidenceyu 2011-07-12
  • 打赏
  • 举报
回复
纯属的这种现实貌似很无聊 你可以显示缩略图,鼠标悬停显示原图
<script type="text/javascript">
this.imagePreview = function() {
xOffset = 10;
yOffset = 30;
$("a.preview").hover(function(e) {
this.t = this.title;
this.title = "";
var c = (this.t != "") ? "<br/>" + this.t : "";
$("body").append("<p id='preview'><img src='" + this.href + "' alt='Image preview' />" + c + "</p>");
$("#preview")
.css("top", (e.pageY - xOffset) + "px")
.css("left", (e.pageX + yOffset) + "px")
.fadeIn("fast");
},
function() {
this.title = this.t;
$("#preview").remove();
});
$("a.preview").mousemove(function(e) {
$("#preview")
.css("top", (e.pageY - xOffset) + "px")
.css("left", (e.pageX + yOffset) + "px");
});
};

$(document).ready(function() {
imagePreview();
});
</script>
ddlein3 2011-07-12
  • 打赏
  • 举报
回复
已经解了!!
豆虫 2011-07-10
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 aspwebchh 的回复:]

HTML code
<img src="http://avatar.profile.csdn.net/B/7/8/2_daf380.jpg" id="img" />
<script type="text/javascript">
var oImg = document.getElementById("img");
oImg.onmouseover = function()
{
thi……
[/Quote]
“大嘴哥”的代码总是平凡中带着新意 用的巧~~~
叶子 2011-07-10
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 aspwebchh 的回复:]

HTML code
<img src="http://avatar.profile.csdn.net/B/7/8/2_daf380.jpg" id="img" />
<script type="text/javascript">
var oImg = document.getElementById("img");
oImg.onmouseover = function()
{
thi……
[/Quote]
恭喜大嘴哥的社区之星!
zjq8888882009 2011-07-10
  • 打赏
  • 举报
回复
求分!
fkueyygyispw 2011-07-08
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 aspwebchh 的回复:]

HTML code
<img src="http://avatar.profile.csdn.net/B/7/8/2_daf380.jpg" id="img" />
<script type="text/javascript">
var oImg = document.getElementById("img");
oImg.onmouseover = function()
{
thi……
[/Quote]
用这个
zell419 2011-07-08
  • 打赏
  • 举报
回复
你是不是还要动画效果 ?


JF ~
挨踢直男 2011-07-08
  • 打赏
  • 举报
回复
<img src="http://avatar.profile.csdn.net/B/7/8/2_daf380.jpg" id="img" />
<script type="text/javascript">
var oImg = document.getElementById("img");
oImg.onmouseover = function()
{
this.style.width="200px";
this.style.height="200px";
}
oImg.onmouseout = function()
{
this.style.width="";
this.style.height=""
}

</script>
灬上海爽爷 2011-07-08
  • 打赏
  • 举报
回复

<img src="http://www.baidu.com/img/baidu_sylogo1.gif" width="270" height="129" onmouseover="javascript:this.width='540';this.height='258';" onmouseout="javascript:this.width='270';this.height='129';" />
灬上海爽爷 2011-07-08
  • 打赏
  • 举报
回复
哦,就是通过JS更改图片的width 跟height属性
onmouseover和onmouseout事件。

87,990

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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