$(".smallimg").bind("click",function(e){
$(".smallimg").parent().css({"border-color":"#8b8b8c"});
$(e.target).parent().css({"border-color":"yellow"});
$("#imgMark").fadeTo("slow","0.01",function(){
$("#imgMark").remove();
$("#imgBox")[0].innerHTML="";
$("#imgBox").append("<img src=\""+$(".smallimg")[0].src+"\" id=\"imgMark\" style=\"margin-top:5px;position:absolute; margin-left:28px\" />");
$("#imgMark").attr("src",e.target.src);
//alert("ffff");
if($("#imgMark").width()>900){
$("#imgMark").width(900);
}
if($("#imgMark").height()>597){
$("#imgMark").height(597);
}
var pos = $("#imgBox").offset();
var left = ($("#imgBox").width()-$("#imgMark").width())/2+pos.left;
var height = ($("#imgBox").height()-$("#imgMark").height())/2+pos.top;
$("#imgMark").css({"left":left,"top":height});
});imgMark 是页面的img对象
imgBox 是imgMark的容器对象
在IE6下面我切换图片了,imgMark的高宽怎么还是上一张图片的,
解决方案 »
- 怎样得到,你所点击对象的ID值呢?谢谢
- 对你们easy的问题,关于form事件的。
- 在dtree中如何添加链接为js函数
- 如何在单击一个按钮事件的同时触发另一个页面的一个按钮的单击事件
- 第三方的div确认提示框为什么不能代替window.confirm()
- 请问几个函数的具体意思…
- 当运行到history.go(-1)时,后面的asp脚本还会运行吗?
- 请问各位,怎么将 一个页面的ACTION 提交到两个FORM里去。进来看看详情,多谢!
- 给分问题,用window.open打开新窗口时怎样使打开的窗口最大化
- 新手请教js异步请求
- jquery treeview, 点击+-号才展开,如何实现?
- ExtJS 设置几个系统管理模块导航条
现在就是加载图片img的宽高取得不正确 晕死