分享
 
 
 

网页中点击连接显示和隐藏过渡效果的图层

王朝html/css/js·作者佚名  2008-05-31
窄屏简体版  字體: |||超大  

<!-- bbs http://www.knowsky.com/bbs-->

<!-- 把下列代码加到<head>区域内 -->

<SCRIPT language=JavaScript>

var isCSS = false;

var isW3C = false;

var isIE4 = false;

var isNN4 = false;

var isIE6 = false;

var isGecko = false;

var isOpera = false;

var isDHTML = false;

var suppressMenus= false;

function autoconfig()

{

if(document && document.images)

{

isCSS= (document.body && document.body.style) ? true : false;

isW3C= (isCSS && document.getElementById) ? true : false;

isIE4= (isCSS && document.all && readIEVer() >= 4.0) ? true : false;

isNN4= (document.layers) ? true : false;

isGecko= (isCSS && navigator && navigator.product && navigator.product == "Gecko");

isOpera= (isCSS && navigator.userAgent.indexOf( "Opera") != -1 );

isIE6CSS= (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) ? true : false;

isIE6= ( isIE6CSS && readIEVer() >= 6.0 );

isDHTML= isCSS && ( isIE4 || isGecko || isOpera );

if( suppressMenus || ( isOpera && readOperaVer() < 7 ) || ( isGecko && navigator.productSub <= 20011022 ) || ( isGecko && navigator.productSub == 20030107 ) )

{

// Opera 6.x doesn't seem to like the DHTML...

// Netscape 6.2 puts the menus in the wrong place...

// Safari, the menus don't go away... problem in ResetMenu

isDHTML= false;

}

}

}

function readIEVer()

{

var agent= navigator.userAgent;

var offset= agent.indexOf( "MSIE" );

if( offset < 0 )

{

return 0;

}

return parseFloat( agent.substring( offset + 5, agent.indexOf( ";", offset ) ) );

}

function montage( href, src, caption, width, animate )

{

// this is the case for browsers that don't support filters...

var cycle= Math.floor( Math.random() * href.length );

// switch off animation if we're not on broadband

var m_montage= ( typeof(animate) != "undefined" ? animate : hasBroadband() );

if( m_montage == false || src.length <= 1 || !( isIE4 || isW3C ) )

{

montagePicker( href, src, caption, cycle );

return;

}

// go build all of the nested DIVs out

monIdx= cycle;

document.writeln( "<div id=\"container\" style=\"width:" + width +"px;height:112px\">" );

for( i = 0; i < src.length; i++ )

{

// set up a placeholder

document.writeln( "\t<div id=\"montage" + i + "\" style=\"display:none\">" );

montagePicker( href, src, caption, i );

document.writeln( "\t</div>" );

}

document.writeln( "</div>" );

// pull the images out

monBlock= new Array( src.length );

monImg= new Array( src.length );

for( i = 0; i < src.length; i++ )

{

monBlock[i]= document.getElementById( "montage" + i ).style;

monImg[i]= document.getElementById( "monimg" + i );

if( monImg[i] == null )

{

montagePicker( href, src, caption, i );

return;

}

//alert( "foo" );

}

monContainer = document.getElementById("container");

montageEffects();

}

function montageEffects()

{

var nextImage= (monIdx + 1) % monImg.length;

// run the transition

if( readIEVer() >= 4.0 )

{

monContainer.style.filter = "blendTrans(duration=1.5) revealTrans(duration=1.0,transition=7)";

monContainer.filters(0).apply();

monContainer.filters(1).apply();

montageSelect( nextImage );

monContainer.filters(0).play();

monContainer.filters(1).play();

}

else

{

montageSelect( nextImage );

}

// asked to be called again a little later

setTimeout( "montageSwap()", monTimeout );

}

function montageSelect( nextImage )

{

//alert( monImg[monIdx].style.visibility );

monBlock[monIdx].display = "none";

monIdx = nextImage;

monBlock[monIdx].display = "block";

}

function montageSwap()

{

if( monImg[monIdx].complete )

{

// move the image index along

montageEffects();

}

else

{

// check again 3 seconds later

setTimeout( "montageSwap()", 3000 );

}

}

function montagePicker( href, src, caption, cycle )

{

if( href[cycle] != null )

{

document.writeln( "\t\t<A HREF=\"" + href[cycle] + "\"><IMG SRC=\"" + src[cycle] + "\" alt=\"" + caption[cycle] + "\" BORDER=\"0\" ID=\"monimg" + cycle + "\"></a>" );

}

else

{

document.writeln( "\t\t<IMG SRC=\"" + src[cycle] + "\" ID=\"monimg" + cycle + "\">" );

}

}

function hasBroadband()

{

if( readIEVer() < 5.0 )

{

return false;

}

try

{

document.body.addBehavior ("#default#clientCaps");

return ( typeof(document.body.connectionType) != "undefined" && document.body.connectionType == "lan" );

}

catch( e )

{

return false;

}

}

//more javascript from http://www.knowsky.com

</SCRIPT>

<!-- 把下列代码加到<body>区域内 -->

<TABLE cellSpacing=0 cellPadding=0 border=0>

<TBODY>

<TR>

<TD width=122>

<SCRIPT language=JavaScript type=text/javascript>

autoconfig();

monTimeout = 2000;

var urls = new Array();

var imgs = new Array();

var caps = new Array();

urls[0] = "http://www.knowsky.com";

imgs[0] = "/img/200406301.jpg";

caps[0] = "说明一";

urls[1] = "http://www.knowsky.com";

imgs[1] = "/img/200406302.jpg";

caps[1] = "说明二";

urls[2] = "http://www.knowsky.com";

imgs[2] = "/img/200406303.jpg";

caps[2] = "说明三";

urls[3] = "http://www.knowsky.com";

imgs[3] = "/img/200406304.jpg";

caps[3] = "说明四";

urls[4] = "http://www.knowsky.com";

imgs[4] = "/img/200406305.jpg";

caps[4] = "说明五";

montage( urls, imgs, caps, 461 );

</SCRIPT>

</TD></TR>

</TBODY></TABLE>

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有