61,115
社区成员
发帖
与我相关
我的任务
分享
//showPictrue()
function showPictrue() {
document.write(" <tr> ");
for(var i=0 ; i<fileNames.length ; i++) {
fileName = fileNames[i];
var tmp = fileName.lastIndexOf(".");
var suffix = fileName.substr(tmp+1);
document.write(" <td> ");
if(suffix == "jpg" || suffix == "png" || suffix == "gif" || suffix == "bmp"){
var urls = "showFullPicture.html?name=" + usbPath + fileName;
filePath = "file:///" + usbPath + fileName;
document.write("<img src="+filePath+" width=144px height=115px onclick='window.open("+ '"' + urls + '"' +")'/>");
}
else{
var folderPath = "images/file.jpg";
document.write("<img src='" + folderPath + "' width=144px height=115px/>");
}
document.write(" </td> ");
if(i%4 == 3)
{
document.write("</tr>");
document.write("<tr>");
for (var j=i-3; j<=i ;j++){
document.write("<td align='center' valign='top'>");
document.write("<FONT color=#FFFFFF size=3 face=����>");
document.write(fileNames[j]);
document.write("</FONT>");
document.write("</td>");
}
document.write("</tr>");
document.write("<tr>");
}
}
if( fileNames.length%4 != 0) {
document.write("</tr>");
document.write("<tr>");
var k = fileNames.length - i%4;
for( ; k<fileNames.length ; k++) {
document.write("<td align='center' valign='top'>");
document.write("<FONT color=#FFFFFF size=3>");
document.write(fileNames[k]);
document.write("</FONT>");
document.write("</td>");
}
}
document.write(" </tr> ");
}
<a href="">Back</a>
<a href="">Next</a>