グラフィックスライドプレーヤーJavascriptバージョン
5391 ワード
// ------------ ------------------------
// 1、 HTML ,js <script language="javascript" src="my.js"><\/script>
// 2、 PHP、ASP : |Http | |Http ...... ,
// str = 'P20010725175318.jpg||P20020307152133.jpg||P20020307152545.jpg||P20030224125949.jpg||P20030319093723.jpg|';
// 3、 , xkq_show( , , |Http )
// xkq_show('myplay',3000,387,150,str);
// 387, 150 myplay str , 3000ms, URL(Http) 。
//************************************************/
// IMG
var NowFrame2 = 1;
// IMG
var MaxFrame2 = 2;
// IMG
var bStart2 = 0;
// 、 、 、
var xkq_width2,xkq_height2,xkq_name2,xkq_time2;
xkq_width2 = 185;
xkq_height2 = 151;
xkq_name2 = 'oTransContainer2';
xkq_time2 = 3000;
//
var img_context2;
//***********************************************
// javascript :xkq_init(width,height)
// :
// width
// height
//***********************************************
function xkq_init2(name,time,width,height)
{
xkq_width2 = width;
xkq_height2 = height;
xkq_name2 = name;
xkq_time2 = time;
document.write('<DIV id="'+xkq_name2+'div" style="FILTER: progid:DXImageTransform.Microsoft.Wipe(GradientSize=1.0, wipeStyle=0, motion=\'forward\'); WIDTH: '+xkq_width2+'px; HEIGHT: '+xkq_height2+'px">'+'<span id="'+xkq_name2+'span">'+'</span>'+'</DIV>');
}
//************************************************
// :xkq_addImg(img_list)
// :
// img_list | , 、
//************************************************
function xkq_addImg2(img_list)
{
var img_array = new Array();
img_array = img_list.split('|');
// addflags TURE, ; FALSE,
var addflags = true;
//
var j = 1 ;
var tmpstr = '';
MaxFrame2 = (img_array.length)/2;
for (var i=0 ; i<img_array.length ; i++ )
{
if ( addflags)
{
if ( j==1 )
tmpstr = '<img src="'+img_array[i]+'" id='+xkq_name2+j+' style="DISPLAY: block" border="0" width="'+xkq_width2+'" height="'+xkq_height2+'" />';
else
tmpstr = '<img src="'+img_array[i]+'" id='+xkq_name2+j+' style="DISPLAY: none" border="0" width="'+xkq_width2+'" height="'+xkq_height2+'" />';
addflags = false;
}else
{
addflags = true;
j = j+1;
if (img_array[i]!='' )
tmpstr = '<a target="_parent" href="'+img_array[i]+'">' + tmpstr + '</a>';
else
tmpstr = '<a target="_parent" href="#">' + tmpstr + '</a>';
img_context2.innerHTML = img_context2.innerHTML + tmpstr;
tmpstr = '';
}
}
}
//*******************************************
// :fnToggle()
// :
//
//*******************************************
function fnToggle2() {
var next = NowFrame2 + 1;
if(next == MaxFrame2+1)
{
NowFrame2 = MaxFrame2;
next = 1;
}
if(bStart2 == 0)
{
bStart2 = 1;
setTimeout('fnToggle2()', xkq_time2);
return;
}
else
{
eval(xkq_name2+'div').filters[0].Apply();
document.images[xkq_name2+next].style.display = "";
document.images[xkq_name2+NowFrame2].style.display = "none";
eval(xkq_name2+'div').filters[0].Play(duration=2);
if(NowFrame2 == MaxFrame2)
NowFrame2 = 1;
else
NowFrame2++;
} setTimeout('fnToggle2()', xkq_time2+3000);
}
//************************************************************************
// :xkq_show(name,time,width,height,img_list)
//
// name
// time
// width
// height
// img_list | , 、
//************************************************************************
function xkq_show2(name,time,width,height,img_list)
{
// , ,
if ( width<=0 || height<=0 )
{
xkq_init2(name,time,20,20);
img_context2 = document.getElementById(xkq_name2+'span');
img_context2.innerHTML = ' !';
return ;
}
xkq_init2(name,time,width,height);
img_context2 = document.getElementById(xkq_name2+'span');
xkq_addImg2(img_list);
fnToggle2();
}