设置大图显示在小图右边但是最右边小图的大图因为显示器宽度的问题不能完全看到
怎样判断如果显示器不能完全显示就把放大镜调整到左边来显示
希望有代码直接贴出来
怎样判断如果显示器不能完全显示就把放大镜调整到左边来显示
希望有代码直接贴出来
解决方案 »
- 请教关于使用appscan 检测"基于DOM的跨站点脚本"漏洞修复问题
- 如何用javascript替代href="#A1"功能
- javascript怎么读xml文件
- 关于jQuery不同文件提示错误问题
- (急)div的图片怎么在iframe上啊(有源码)
- javascript中的自定义数据集
- document.Form1.province 为空或不是对象
- 主问vml中group中的矩形长度在屏幕上有多长
- 为什么不能动态 元素 !!!!!!! 急!!!!!!!!!!
- 请问:javascript:后面跟的东西是什么意思?
- 使用Javascript来创建一个响应式的超酷360度全景图片查看幻灯效果
- Extjs 查询统计
<!DOCTYPE HTML>
<html>
<head>
<meta charset="gb2312" />
<title></title>
<link rel="stylesheet" href="http://yui.yahooapis.com/2.9.0/build/reset/reset-min.css" />
<style>
body {font-size:12px;}
img {display:block;}
.img {
position:absolute;
}
.a {
left:5px; top:100px;
}
.b {
right:5px; top:100px;
}
.c {
right:85px; top:150px;
}
.d {
right:220px; top:180px;
}
.bigger {
position:absolute; left:51px; top:0;
}
</style>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<div class="img a">
<img src="http://avatar.profile.csdn.net/E/8/7/2_tjh666.jpg" width="50" />
</div>
<div class="img b">
<img src="http://info-database.csdn.net/Upload/2012-03-26/dr_shanghai-220-90-0320.jpg" width="50" />
</div>
<div class="img c">
<img src="http://info-database.csdn.net/Upload/2012-03-26/dr_shanghai-220-90-0320.jpg" width="50" />
</div>
<div class="img d">
<img src="http://info-database.csdn.net/Upload/2012-03-26/dr_shanghai-220-90-0320.jpg" width="50" />
</div>
<script>
var docWidth = $(document).width();
$('.img').mouseover(function(){
var img = document.createElement('img');
img.src = $(this).find('img')[0].src;
img.className = 'bigger';
if( this.offsetLeft + img.width + 51 >= docWidth ){
img.style.left = -(img.width+1) + 'px';
}
this.appendChild(img);
}).mouseout(function(){
$(this).find('img:eq(1)').remove();
})
</script>
</body>
</html>
楼主看看