<STYLE type=text/css>#divScroller1 {
Z-INDEX: 9; OVERFLOW: hidden; WIDTH: 438px; POSITION: absolute; HEIGHT: 278px; visbility: visible
}
.dynPage {
FONT-SIZE: 12px; Z-INDEX: 10; LEFT: 0px; VISIBILITY: hidden; COLOR: black; FONT-FAMILY: arial,helvetica,sans-serif; POSITION: absolute; TOP: 0px
}
</STYLE> <SCRIPT language=JavaScript type=text/javascript>
function lib_bwcheck(){ //Browsercheck (needed)
this.ver=navigator.appVersion
this.agent=navigator.userAgent
this.dom=document.getElementById?1:0
this.opera5=this.agent.indexOf("Opera 5")>-1
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
this.ie=this.ie4||this.ie5||this.ie6
this.mac=this.agent.indexOf("Mac")>-1
this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
return this
}
var bw=new lib_bwcheck()/*** variables to configure... ***/var numScrollPages = 4 //Set the number of pages (layers) here.
var transitionOut = 1; //The 'out' effect... 0= no effect, 1= fade
var transitionIn = 1; //The 'in' effect... 0= no effect, 1= fade, 2= slide
var slideAcceleration = 0.2; //If you use the slide animation, set this somewhere between 0 and 1.if(document.layers){ //NS4 resize fix...
scrX= innerWidth; scrY= innerHeight;
onresize= function(){if(scrX!= innerWidth || scrY!= innerHeight){history.go(0)} }
}
function scrollerobj(obj,nest){
nest = (!nest)?"":'document.'+nest+'.'
this.elm = bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):document.getElementById(obj)
this.css = bw.ns4?this.elm:this.elm.style
this.doc = bw.ns4?this.elm.document:document
this.obj = obj+'scrollerobj'; eval(this.obj+'=this')
this.x = (bw.ns4||bw.opera5)?this.css.left:this.elm.offsetLeft
this.y = (bw.ns4||bw.opera5)?this.css.top:this.elm.offsetTop
this.w = (bw.ie4||bw.ie5||bw.ie6||bw.ns6)?this.elm.offsetWidth:bw.ns4?this.elm.clip.width:bw.opera5?this.css.pixelWidth:0
this.h = (bw.ie4||bw.ie5||bw.ie6||bw.ns6)?this.elm.offsetHeight:bw.ns4?this.elm.clip.height:bw.opera5?this.css.pixelHeight:0
}
//object methods...
scrollerobj.prototype.moveTo = function(x,y){
if(x!=null){this.x=x; this.css.left=x}
if(y!=null){this.y=y; this.css.top=y}
}
scrollerobj.prototype.moveBy = function(x,y){this.moveTo(this.x+x,this.y+y)}
scrollerobj.prototype.hideIt = function(){this.css.visibility='hidden'}
scrollerobj.prototype.showIt = function(){this.css.visibility='visible'}/****************************************************************/var onlineormyefile = 1;
var activePage = null;
var busy = 0;
function activate(num){
if (activePage!=pages[num] && !busy){
busy = 1;
if (transitionOut==0 || !bw.opacity){ activePage.hideIt(); activateContinue(num); }
else if (transitionOut==1) activePage.blend('hidden', 'activateContinue('+num+')');
}
}
function activateContinue(num){
busy = 1;
activePage = pages[num];
activePage.moveTo(0,0);
if (transitionIn==0 || !bw.opacity){ activePage.showIt(); busy=0; }
else if (transitionIn==1) {
activePage.blend('visible', 'busy=0');
}
else if (transitionIn==3) { activePage.slide(0, slideAcceleration, 40, 'busy=0'); }
//==== 调用变换过程====
startshow(num)
}//============ 变换设置 ==========
function startshow(num){
if (num == 1)
{ num = 2; }
else
if (num == 2)
{ num = 3; }
else
if (num == 3)
{ num = 4; }
else
if (num == 4)
{ num = 1; }
setTimeout('activate('+num+')',5000);
}scrollerobj.prototype.blend= function(vis, fn){
if (bw.ie5||bw.ie6 && !bw.mac) {
if (vis=='visible') this.css.filter= 'blendTrans(duration=0.9)';
else this.css.filter= 'blendTrans(duration=0.6)';
this.elm.onfilterchange = function(){ eval(fn); };
this.elm.filters.blendTrans.apply();
this.css.visibility= vis;
this.elm.filters.blendTrans.play();
}
else if (bw.ns6 || bw.ie&&!bw.mac){
this.css.visibility= 'visible';
vis=='visible' ? this.fadeTo(100, 7, 40, fn) : this.fadeTo(0, 9, 40, fn);
}
else {
this.css.visibility= vis;
eval(fn);
}
};
var pageslidefadeLoaded = 0;
function initPageSlideFade(){
scroller1 = new scrollerobj('divScroller1');
pages = new Array();
pages[0] = null;
for (var i=1; i<=numScrollPages; i++){
pages[i] = new scrollerobj('dynPage'+i, 'divScroller1');
pages[i].moveTo(0,0);
}
bw.opacity = ( bw.ie && !bw.ie4 && navigator.userAgent.indexOf('Windows')>-1 ) || bw.ns6
if (bw.ie5||bw.ie6 && !bw.mac) pages[1].css.filter= 'blendTrans(duration=0.6)'; // Loads the windows 9.x filters module.
activateContinue(1); //if (bw.ie) for(var i=0;i<document.links.length;i++) document.links[i].onfocus=document.links[i].blur;
pageslidefadeLoaded = 1;
}
//if the browser is ok, the script is started onload..
if(bw.bw && !pageslidefadeLoaded) onload = initPageSlideFade;
</SCRIPT>
<DIV id=divScroller1>
<DIV class=dynPage id=dynPage1><IMG height=278
src="1.gif" width=438></DIV>
<DIV class=dynPage id=dynPage2><IMG height=278
src="2.gif" width=438></DIV>
<DIV class=dynPage id=dynPage3><IMG height=278
src="3.gif" width=438></DIV>
<DIV class=dynPage id=dynPage4><IMG height=278
src="4.gif"
width=438></DIV></DIV>
解决方案 »
- 求助关于swfupload删除预览文件
- 关于ext的API --mxgraph
- 一个javascript的错误,很简单,把一个文本框的值显示到另一个文本框中。
- vml层次的问题
- 表格行数不确定,如何为表格最后一行指定样式?
- 不同网页包含的同一个js文件,每次访问是从缓存里读的吗?
- 有没有方法取到一个汉字的拼音编码???急!!!
- ---------------超难问题,请高手帮忙--------------
- 如何验证用户输入的日期格式?
- 请问那种text输入框或表格的边框是虚线的效果是怎么做的,有源代码吗?谢谢!
- 解析字符串的问题?请高手解决~
- 在JS中怎么声明一个数组?我如下的方法不对,是在JAVA中声明的,JS如何声明?
<!-- // BannerAD
var bannerAD=new Array();
var bannerADlink=new Array();
var adNum=0;//初始化. bannerAD[i]="图片地址"; bannerADlink[i]="连接地址".
bannerAD[0]="http://www.17u.net/uploadmpzppic/200433011238.jpg";
bannerADlink[0]="http://www.17u.net/mytongcheng/memberprofile.asp?id=1441";
bannerAD[1]="http://www.17u.net/uploadmpzppic/2004330112050.gif";
bannerADlink[1]="http://www.17u.net/mytongcheng/memberprofile.asp?id=3615";
bannerAD[2]="http://www.17u.net/uploadmpzppic/2004330132230.gif";
bannerADlink[2]="http://www.17u.net/mytongcheng/memberprofile.asp?id=2837";
var preloadedimages=new Array();
for (i=1;i<bannerAD.length;i++){
preloadedimages[i]=new Image();
preloadedimages[i].src=bannerAD[i];
}
function setTransition(){
if (document.all){
bannerADrotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);
bannerADrotator.filters.revealTrans.apply();
}
}function playTransition(){
if (document.all)
bannerADrotator.filters.revealTrans.play()
}function nextAd(){
if(adNum<bannerAD.length-1)adNum++ ;
else adNum=0;
setTransition();
document.images.bannerADrotator.src=bannerAD[adNum];
playTransition();
theTimer=setTimeout("nextAd()", 5000);
}function jump2url(){
jumpUrl=bannerADlink[adNum];
jumpTarget='';
if (jumpUrl != ''){
if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
else location.href=jumpUrl;
}
}function displayStatusMsg() {
status=bannerADlink[adNum];
document.returnValue = true;
}
//-->
</SCRIPT>
<IMG border="1" name="bannerADrotator" height="144" src="http://www.17u.net/uploadmpzppic/200433011238.jpg" style="FILTER: revealTrans(duration=2,transition=20)"></A><SCRIPT language="JavaScript">nextAd()</SCRIPT>
<script>
var ImgUrl=new Array();
var ImgLink=new Array();
var iCount=0;
ImgUrl[1]="参加补给训练的海军167驱逐舰.jpg";
ImgLink[1]="#";
ImgUrl[2]="中国的航母.jpg";
ImgLink[2]="#";
ImgUrl[3]="中国自行火炮系列.jpg";
ImgLink[3]="#";
ImgUrl[4]="中国人民警察警种分辨99式警服的警监警衔.jpg";
ImgLink[4]="#";
ImgUrl[5]="中国人民警察警种分辨99式警服的专业胸徽.jpg";
ImgLink[5]="#";var ImgPre=new Array();
var kCount=0;
for(iIndex=1;iIndex<=5;iIndex++)
{
if((ImgUrl[iIndex]!="")&&(ImgLink[iIndex]!=""))
{
kCount++;
}
else
{
break;
}
}
function PlayTran()
{
if(document.all)
ImgInit.filters.revealTrans.play();
}var iKey=0;
function NextImg()
{
if(iCount<kCount)iCount++;
else iCount=1;
if(iKey==0)
{
iKey=1;
}
else if(document.all)
{
ImgInit.filters.revealTrans.Transition=6;
ImgInit.filters.revealTrans.apply();
PlayTran(); }
document.images.ImgInit.src=ImgUrl[iCount];
TheTimer=setTimeout("NextImg()",3000);
}function GoUrl()
{
JumpUrl=ImgLink[iCount];
JumpTarget='_blank';
if(JumpUrl!='')
{
if(JumpTarget!='')
window.open(JumpUrl,JumpTarget);
else
location.href=JumpUrl;
}
}
</script>
<a href="javascript:GoUrl()"><img style="border-left-color:black;filter:revealTrans(duration=2,transition=20);border-bottom-color:black;color:#000000;border-top-color:black;border-right-color:black;" height=400 width=500 src="歼10.jpg" border=1 name=ImgInit></a>
第一:window的定时器
第二:img的src的动态修改。
var imgLink=new Array();
var adNum=0;
imgLink[1]="http://www.clubol.com";
imgLink[2]="http://www.mpsky.com.cn"; imgUrl[1]="images/lianjie/logo_readerclub.gif";
imgUrl[2]="images/lianjie/yy.jpg"; var imgPre=new Array();
var j=0;
for (i=0;i<=1;i++) {
if(imgLink[i]!="") {j++;}
else {break;}
}
function playTran(){
if (document.all)
imgInit.filters.revealTrans.play();
} var key=0;
function nextAd(){
if(adNum<j)adNum++ ;
else adNum=1;
if( key==0 ){key=1;}
else if (document.all){
imgInit.filters.revealTrans.Transition=6;
imgInit.filters.revealTrans.apply();
playTran(); }
document.images.imgInit.src=imgUrl[adNum];
jumpUrl=imgLink[adNum];
theTimer=setTimeout("nextAd()", 5000);
}
function goUrl(){
jumpTarget='_blank';
if (jumpUrl != ''){
if (jumpTarget != '') window.open(jumpUrl,jumpTarget);
else location.href=jumpUrl;
}
}