点击某图片,相应位置显示出该图片。 本帖最后由 anbs01 于 2010-01-07 17:35:37 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <img id="aaa" width="200" height="200"/><img width="50" height="50" big="http://avatar.profile.csdn.net/F/1/1/2_chen_wen_xiu.jpg" src="http://avatar.profile.csdn.net/F/1/1/2_chen_wen_xiu.jpg" onclick="document.getElementById('aaa').src=this.getAttribute('big')"/> <img width="50" height="50" big="http://avatar.profile.csdn.net/2/8/8/2_frankrenping.jpg" src="http://avatar.profile.csdn.net/2/8/8/2_frankrenping.jpg" onclick="document.getElementById('aaa').src=this.getAttribute('big')" /> <img width="50" big="http://avatar.profile.csdn.net/6/8/3/2_wxg22526451.jpg" height="50" src="http://avatar.profile.csdn.net/6/8/3/2_wxg22526451.jpg" onclick="document.getElementById('aaa').src=this.getAttribute('big')" /> 如果大图就是原图的话,可以去掉big属性.onclick=document.getElementById('aaa').src=this.src" var img="<img src="+this.src+">";document.getElementById("divId").innerHTML=img; http://topic.csdn.net/u/20090421/11/2daa637d-c13c-409e-b742-dac30daa06a0.html1楼和3楼 你看看这个行不:$("a.preview").toggle(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"); }); js表单获取焦点的问题 asp可以实现这样的功能吗?代码出来结分。 如何在.js文件中,得到我们所嵌入jsp或者html页面的document new Function()这种写法是不是很少用? 刷新的问题 求教 TEXTAREA中的<br>替换 如何判断客户端有没有装realplay 求JavaScript的中英文对照教材或资料 关于iframe的问题,超级难!100分 想实现 优酷视频中开灯 关灯效果 这么短的代码都会出问题? 能否通过把Dll文件打包成cab文件,然后客户端通过js调用dll
<img id="aaa" width="200" height="200"/><img width="50" height="50" big="http://avatar.profile.csdn.net/F/1/1/2_chen_wen_xiu.jpg" src="http://avatar.profile.csdn.net/F/1/1/2_chen_wen_xiu.jpg" onclick="document.getElementById('aaa').src=this.getAttribute('big')"/>
<img width="50" height="50" big="http://avatar.profile.csdn.net/2/8/8/2_frankrenping.jpg" src="http://avatar.profile.csdn.net/2/8/8/2_frankrenping.jpg" onclick="document.getElementById('aaa').src=this.getAttribute('big')" />
<img width="50" big="http://avatar.profile.csdn.net/6/8/3/2_wxg22526451.jpg" height="50" src="http://avatar.profile.csdn.net/6/8/3/2_wxg22526451.jpg" onclick="document.getElementById('aaa').src=this.getAttribute('big')" />
onclick=document.getElementById('aaa').src=this.src"
document.getElementById("divId").innerHTML=img;
$("a.preview").toggle(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");
});