动态显示图片 Js + html

<!-- theShowImg.htm -->

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <script language="javascript" src="showImgsJs.js" ></script>
</table>
</body>
</html>

 

//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 = "<tr>";
 beginHtml += "<td colspan='" + colNum +"' align='center'>pictures<hr></td>";
 beginHtml += "</tr>";
 //alert(beginHtml);
 document.write(beginHtml);
 
 for(var row=0; row<=3; row++)
 { 
  htmlShow +="<tr>";  
   numBegin = row * colNum + 1;
   numEnd = (row+1) * colNum + 1 ;
  for(var col=numBegin; col<numEnd; col++)
  {
   imgName = "Img/" + theImgs[col] + ".jpg"
   htmlShow += "<td align='center'>"; 
   
   var boolShow;
   if(col <=theCount)  
    boolShow = "style='visibility:visible;'";
   else
    boolShow = "style='visibility:hidden;'";   

   htmlShow += "<img src= '" + imgName + "' width='90' height='120' "+ boolShow +">";
   htmlShow += "<br>" + "<a href='#' onClick = 'showTheInf()'"+ boolShow +" >"+ imgName + "</a><br>&nbsp;";
   htmlShow += "</td>";
  }
  htmlShow +="</tr>";
 }
 document.write(htmlShow);
 

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

打开窗口

<a href="#" onClick="showResume(12)">theName12</a>

<script language="javascript">
 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);
 }
</script>

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值