📄 photoplay.js
字号:
nextImg = curImg+1;
if(curImg==(numImgs-1))
{
nextImg = 0;
}
if(curImg+1>numImgs)
{
nextImg = nextImg-numImgs;
}
}
strIn = "<span style='WIDTH: 75px; HEIGHT: 75px'>"+strA+"</span> ";
strIn = strIn.replace("/b_","/s_");
divStr += strIn;
}
document.getElementById("div1").innerHTML = divStr;
if(!bFirst)
{
if (browserCanBlend)
{
var divTrans = '选择效果:<select name="transitionType" size=1 onchange= "change_transition()" ><option value=15 selected>随机显示</option> <option value=0 >混合效果</option> <option value= 1 >百叶窗</option> <option value=2 >棋盘效果</option> <option value=3 >斜式效果</option> <option value=4 >开门见山</option> <option value=5 >擦除效果</option> <option value= 6 >虹式效果</option> <option value=7 >风车效果</option> <option value=8 >波纹荡漾</option> <option value=9 >时钟转动 </option> <option value=10 >雨丝效果</option> <option value=11 >滑动方式</option> <option value=12 >雪花显示</option> <option value=13 >盘旋收缩</option> <option value =14 >伸展方式</option> </select> ';
document.getElementById("div2").innerHTML = divTrans;
}
bFirst = true;
}
return true;
}
function GetBorder(i,j)
{
if(i==j)
return " class=uimgSlide ";
return " border=0 ";
}
// scales the current image so that it fits within the control
// while preserving the aspect ratio of the image
function ScaleImage(i)
{
// calculate the remaining avaialble width and height
var iAvailableWidth = 60;//span.clientWidth;;
var iAvailableHeight = 60;//span.clientHeight;
// calculate the scale to use for the image. Note, the image
// will never be stretched beyond it's actual width and height,
// and thus the scale max is 1
iFullImageWidth = imageWidthArray[i];
iFullImageHeight = imageHeightArray[i];
var flScale = Math.min( 1,Math.min((iAvailableWidth /iFullImageWidth),(iAvailableHeight /iFullImageHeight)));
// set the width of the image
var width = iScaledImageWidth = Math.round(iFullImageWidth * flScale);
// set the height of the image
var height = iScaledImageHeight = Math.round(iFullImageHeight * flScale);
// center the image by adjusting it's left and top values
var iLeft = Math.floor((iAvailableWidth - iScaledImageWidth) / 2);
var iTop = Math.floor((iAvailableHeight - iScaledImageHeight) / 2);
var style="style='HEIGHT: "+height+"; WIDTH: "+width+"'";
return style;
}
function change_transition()
{
current_transition = document.all.transitionType.selectedIndex;
//alert(current_transition);
if(current_transition == 0)
current_transition = 15;
else
current_transition--;
}
function imgLoadNotify()
{
imgIsLoaded = true;
}
function GetChecked()
{
flag = !flag;
}
function changeSlide(n)
{
if (document.all)
{
/* transistion effects */
if (browserCanBlend)
{
var do_transition;
//alert(current_transition);
if (current_transition == (transition_count))
{
do_transition = Math.floor(Math.random() * transition_count);
}
else
{
do_transition = current_transition;
}
document.all.imgp.style.filter=transitions[do_transition];
document.all.imgp.filters[0].Apply();
}
else
{
document.all.imgp.style.filter="blendTrans(duration=1)";
document.all.imgp.filters.blendTrans.Apply();
}
}
if(n>=0)
{
curImg = n;
var s = document.getElementById("div1").innerHTML;
var sID = "id="+n;
var astrItems = s.split(" ");
var iItemSep;
var str;
var strInner = "";
for (var i=0; i < astrItems.length; i++)
{
str = astrItems[i];
if(str.indexOf("class=uimgSlide") != -1)
{
if(str.indexOf(sID) == -1)
{
str = str.replace("class=uimgSlide", "border=0");
}
}
if(str.indexOf(sID) != -1)
{
str = str.replace("border=0", "class=uimgSlide");
}
strInner += str+" ";
}
document.getElementById("div1").innerHTML = strInner;
}
imgIsLoaded = false;
var bn = blogName;
if(onlyOneBlog == 0)
{
bn = imageBlogArray[curImg];
}
var htmlCont = "<center>" +
"<a style=\"cursor:hand;\" onclick=\"event_click();\"><img src=\"" + imageSrcArray[curImg] + "\" alt=\"" + imageNameArray[curImg] + "\"";
if (imageWidthArray[curImg] > 0 && imageHeightArray[curImg] > 0)
{
htmlCont += (imageHeightArray[curImg]>330)?" height=330":" width=" + imageWidthArray[curImg] + " height=" + imageHeightArray[curImg];
}
htmlCont += " border=0 hspace=10 vspace=10 class=uimg width=512 height=384 onload=\"imgLoadNotify();\"></a>";
var a = flag?("<br><span class=yphsmhdr>" + imageNameArray[curImg] + "</span></center>"):"";
htmlCont +=a;
var pnumLine = "<span>";
pnumLine += replaceNum(SHOWINGSTRING, "%slideNum", eval(curImg+1));
pnumLine += "</span>";
document.getElementById("pnumDiv").innerHTML = pnumLine;
document.getElementById("imgp").innerHTML = htmlCont;
if (document.all)
{
document.all.imgp.filters[0].Play();
}
preloadRange(curImg-4,_PRELOADRANGE);
}
function forward()
{
if ((curImg+1) >= numImgs)
{
curImg = 0;
changeSlide();
stop();
/*if(isLastPage == "0")
{
if(confirm("播放下"+pageCount+"张图片?"))
{
document.location.href=slideshow_end_url;
}
} */
return;
}
imgIsLoaded = false;
//imgIsLoaded = (curImg+_PRELOADRANGE<numImgs)?preloadRange(curImg+1,_PRELOADRANGE):preloadRange(curImg+1,numImgs-curImg-1);
imgIsLoaded = preloadRange(curImg-4,_PRELOADRANGE);
if (!arrPreload[curImg+1])
{
curImg++;
}
else
{
curImg++;
}
changeSlide();
}
function rewind()
{
curImg--;
if (curImg < 0)
{
curImg = numImgs-1;
changeSlide();
}
else
changeSlide();
}
function stop()
{
window.clearInterval(timerId);
timerId = -1;
document.playbtn.src = buttonImgPfx + buttonOffArray[0];
document.stopbtn.src = buttonImgPfx + buttonOnArray[1];
imgIsLoaded = true;
}
function play()
{
interval = speedControl;
forward();
if (timerId == -1)
timerId = window.setInterval('forward();', interval);
document.playbtn.src = buttonImgPfx + buttonOnArray[0];
document.stopbtn.src = buttonImgPfx + buttonOffArray[1];
}
function setButton(direction)
{
interval = speedControl;
if (timerId != -1) { window.clearInterval(timerId); timerId = window.setInterval("forward();", interval); }
imgIsLoaded = true;
if (direction == 0)
{
document.prevbtn.src = buttonImgPfx + buttonOnArray[2];
window.setTimeout("document.prevbtn.src = buttonImgPfx + buttonOffArray[2];", 1500);
}
else
{
document.fowdbtn.src = buttonImgPfx + buttonOnArray[3];
window.setTimeout("document.fowdbtn.src = buttonImgPfx + buttonOffArray[3];", 1500);
}
}
//*****************[End]**************
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -