HTML显示动态图,动态显示图片 Js + html

这是一个用于展示网页中图片的JavaScript脚本,定义了每行显示的图片数量、总图片数,并通过循环结构生成HTML代码以展示指定文件夹内的图片。脚本中包含了图片的隐藏与显示控制,适用于创建简单的图片轮播效果。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

无标题文档

//showImgsJs.js

// JavaScript Document

var htmlShow = ""

var imgName ="";

var numBegin,numEnd;

var colNum = 7;  //一行显示的图片数量

var theCount = 12;//总共有多少图片

//文件夹里图片的名称集合

var theImgsName = "0Zero|1First|2Second|3Third|blue|green|color|7|8|9|10|11|12|13|14|15|";

var theImgs = theImgsName.split("|");

var beginHtml = "

";

beginHtml += "

pictures
";

beginHtml += "

";

//alert(beginHtml);

document.write(beginHtml);

for(var row=0; row<=3; row++)

{

htmlShow +="

";

numBegin = row * colNum + 1;

numEnd = (row+1) * colNum + 1 ;

for(var col=numBegin; col

{

imgName = "Img/" + theImgs[col] + ".jpg"

htmlShow += "

";

var boolShow;

if(col <=theCount)

boolShow = "style='visibility:visible;'";

else

boolShow = "style='visibility:hidden;'";

htmlShow += "%22%20+%20imgName%20+%20%22";

htmlShow += "
" + ""+ imgName + "
 ";

htmlShow += "

";

}

htmlShow +="

";

}

document.write(htmlShow);

//=======================================End

打开窗口

theName12

function showResume(thePlace)

{

actionto= "resumeS/resume" + thePlace + ".htm";

var theStyle = "toolbar=no, status=no,menubar=no,scrollbars=no,resizable=Yes,width=720,height=528,left=50,top=50"

window.open(actionto,"temp",theStyle);

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值