如何用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>运行后单击左边图片,右边的层会填充该图片。 EXTjs问题 求一基础入门级正则表达式 请问替换中文字符问题 能不能用javasript代码判断页面内容都已经载入完成?谢谢 请教ie的一个诡异问题 如何不点击显示隐藏对象? 是不是正则? meizz(梅花雨)请进 JS怎么取到控件改变后的值? 前后端不分离webpack怎么用 怎么让光标离开后,把下拉菜单还原? 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>运行后单击左边图片,右边的层会填充该图片。