如何用JavaScript实现图片平铺效果 RT,点击左边小图片的时候,在右侧的div或者table里,用这个小图片添满,请教高手指导下 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Ob.style.backgroundImage='url(图片)'; rightDiv.style.backgroundImage="url(image/name.jpg)"; rightDiv.style.backgroundRepeat="repeat"; <html><head><style>#img1 { float:left; width:255px; height:142px;}#imageRepeat { float:left; margin-left:10px; width:600px; height:500px; border:2px solid red;}</style><script>function fillDiv(){ document.getElementById("imageRepeat").style.background="url("+document.getElementById("img1").src+") repeat";}</script></head><body><img id="img1" src="01.jpg" onclick="fillDiv()"/><div id="imageRepeat"></div></body></html>运行后单击左边图片,右边的层会填充该图片。 可编辑树-表 js如何判断页面是否加载成功?急!!!!!!!! html图片特效, 这段js怎么解释 菜鸟问个图片翻页的问题(焦点图) JS元素控制问题 求js和jquery仿百度音乐盒的拉伸效果 响应式布局,有什么成熟方案呢? 请教各位哪里不对? 多项选择,急! 怎么让光标离开后,把下拉菜单还原? JS日期问题
rightDiv.style.backgroundRepeat="repeat";
<html>
<head>
<style>
#img1 {
float:left;
width:255px;
height:142px;
}
#imageRepeat {
float:left;
margin-left:10px;
width:600px;
height:500px;
border:2px solid red;
}
</style>
<script>
function fillDiv()
{
document.getElementById("imageRepeat").style.background="url("+document.getElementById("img1").src+") repeat";
}
</script>
</head>
<body>
<img id="img1" src="01.jpg" onclick="fillDiv()"/>
<div id="imageRepeat"></div>
</body>
</html>运行后单击左边图片,右边的层会填充该图片。