藍森林首頁 | 返回主頁 | 本站地圖 | 站內搜索 | 聯繫信箱 |
 您目前的位置:首頁 > 自由軟件 > 技術交流 > 應用編程


    

藍森林 http://www.lslnet.com 2006年8月25日 8:28

求金翅擘海幫助??

經常有人求金翅擘海大哥,我也有麻煩了,求金翅擘海大俠幫助。。。
在新浪的體育頻道中有一種flash焦點滾動幻燈片,原來在好多網站上轉載,但現在都打不開了,正好現在需要用上,我想要更改那個東西的大小但改了好多遍都不成功。希望金翅擘海幫助我。。
就是這個網站:http://sports.sina.com.cn/

新浪的是flash的,你也可做成javascript的:
[html]
<!--begin:圖片輪換開始-->
<script language=JavaScript>
var imgUrl=new Array();
var imgLink=new Array();
var imgTz=new Array();
var buttonShow=1;
var buttonPos=1;
var buttonX;
var buttonY;
var bakularCode=""
var adNum=0;
var dakularCode="";
imgUrl[1]="http://www.icxo.com/images/focus/shandong.jpg";
imgLink[1]="http://finance.icxo.com/htmlnews/2005/09/07/661868.htm";
imgTz[1]="半年收本QQ搶佔滬黑市場";
imgUrl[2]="http://www.icxo.com/images/focus/hai.jpg";
imgLink[2]="http://finance.icxo.com/htmlnews/2005/09/02/659032.htm";
imgTz[2]="傅成玉反思中海油收購案";
imgUrl[3]="http://www.icxo.com/images/focus/shiyou.jpg";
imgLink[3]="http://finance.icxo.com/htmlnews/2005/09/07/662140.htm";
imgTz[3]="煤變油成新一輪資源浪費?";
imgUrl[4]="http://www.icxo.com/images/focus/shandong.jpg";
imgLink[4]="http://finance.icxo.com/htmlnews/2005/09/05/660108.htm";
imgTz[4]="山東高耗能GDP躍進難再現";
var imgPre=new Array();
for (i=1;i<8;i++)
{
        imgPre[i]=new Image();
    imgPre[i].src=imgUrl[i];
}
function setTransition()
{
        if (document.all)
        {
                imgUrlrotator.filters.revealTrans.Transition=23;//Math.floor(Math.random()*23)
            imgUrlrotator.filters.revealTrans.apply();
        }
}
function playTransition()
{
if (document.all)
imgUrlrotator.filters.revealTrans.play()
}
function nextAd(toNum)
{
        if(adNum<imgUrl.length-1)
        adNum++ ;
        else
        adNum=1;
   if(toNum!=null) adNum=toNum;
   setTransition();
document.images.imgUrlrotator.src=imgUrl[adNum];
document.getElementById('linktext').innerHTML=imgTz[adNum];
  document.images.imgUrlrotator.alt='今日頭條:'+imgTz[adNum];
document.getElementById('linktext').innerHTML="<a href="+imgLink[adNum]+" target=_blank class=px14-lh20>"+imgTz[adNum]+"</a>";
playTransition();
checkButton();
if(toNum!=null)
        {toNum=null;theTimer=setTimeout("nextAd()", 7000);}
else
        {theTimer=setTimeout("nextAd()", 7000);}
}
function jump2url()
{
jumpUrl=imgLink[adNum];jumpTarget='_blank';
        if (jumpUrl != '')
        {                if (jumpTarget != '')
            window.open(jumpUrl,jumpTarget);
                else location.href=jumpUrl;
   }
}
function displayStatusMsg()
{
        status=imgLink[adNum];
    document.returnValue = true;
}
function checkButton()
{
        for(i=1;i<=imgUrl.length-1;i++)
                {if(i==adNum)
                        //document.getElementById('bt'+i).style.backgroundColor='#00FF00';
                        eval("bt"+i+".style.backgroundColor='#9B0000';bt"+i+".style.color='#FFFFFF';");
                else
                        eval("bt"+i+".style.backgroundColor='#CCCCCC';bt"+i+".style.color='#000000';");
                }
}
function dakularButtons()
{
        if(buttonShow==1)
        {
                switch(buttonPos)
                {
                        case 1:{buttonX=160+20-imgUrl.length*20;buttonY=16;break;}
                        case 2:{buttonX=160+20-imgUrl.length*20;buttonY=125;break;}
                        case 3:{buttonX=imgUrl.length*20-100;buttonY=16;break;}
                        case 4:{buttonX=imgUrl.length*20-100;buttonY=125;break;}
                        default:{buttonX=160+20-imgUrl.length*20;buttonY=16;break;}
                }
                for(i=1;i<=imgUrl.length-1;i++)
                {
                        dakularCode=dakularCode+"<div id='bt"+i+"' style='display:inline; height=14px; width:20px; border:1px solid #000000; background-color:#f7f7f7; color:#000000; font-size:12px; line-height:14px;' align='center' onMouseOver=this.style.backgroundColor='#FFFFFF';this.style.color='#000000';this.style.cursor='hand' onMouseOut=checkButton(); onClick='clearTimeout(theTimer);nextAd("+i+");'>"+i+"</div>";
                }
                dakularCode="<div style='display:inline; position:relative;left:"+buttonX+"px; top:"+buttonY+"px; z-index:1;'>"+dakularCode+"</div>";
                document.write(dakularCode);
        }
}
</script>
<table border="0" cellpadding="0" cellspacing="0" id=newsTable style="position:relative; top:-10px;right:0px; font-size:12px;">
<script language="javascript">dakularButtons();</script><tr><td><a onMouseOver="displayStatusMsg();return document.returnValue;" onMouseOut="status='';" href="javascript:jump2url()"><img style="FILTER: revealTrans(duration=1,transition=18); border:1px solid #000000" src="javascript:nextAd()" width=160 height=150 border=0 name=imgUrlrotator alt="今日頭條"></a></td></tr>
<tr><td bgcolor="#f0f0f0" align="center" style="border-bottom:1px solid #000000; border-left:1px solid #000000;border-right:1px solid #000000;" height="20"><label id="linktext"></label></td></tr>
</table>
<!--begin:圖片輪換結束-->
[/html]

非常感謝金翅擘海的幫助!!!

金翅擘海大哥,您的方法成功了,可是他的按鈕無法實現和圖片融合在一起的感覺,所以還是不能通過??怎麼辦呢???

給這段加個alpha濾鏡半透明
[code]
<div id='bt"+i+"' style='display:inline; height=14px; width:20px; border:1px solid #000000; background-color:#f7f7f7; color:#000000; font-size:12px; line-height:14px;' align='center' onMouseOver=this.style.backgroundColor='#FFFFFF';this.style.color='#000000';this.style.cursor='hand' onMouseOut=checkButton(); onClick='clearTimeout(theTimer);nextAd("+i+");'>"+i+"</div>";
[/code]

[html]
<!--begin:圖片輪換開始-->
<script language=JavaScript>
var imgUrl=new Array();
var imgLink=new Array();
var imgTz=new Array();
var buttonShow=1;
var buttonPos=1;
var buttonX;
var buttonY;
var bakularCode=""
var adNum=0;
var dakularCode="";
imgUrl[1]="http://www.icxo.com/images/focus/shandong.jpg";
imgLink[1]="http://finance.icxo.com/htmlnews/2005/09/07/661868.htm";
imgTz[1]="半年收本QQ搶佔滬黑市場";
imgUrl[2]="http://www.icxo.com/images/focus/hai.jpg";
imgLink[2]="http://finance.icxo.com/htmlnews/2005/09/02/659032.htm";
imgTz[2]="傅成玉反思中海油收購案";
imgUrl[3]="http://www.icxo.com/images/focus/shiyou.jpg";
imgLink[3]="http://finance.icxo.com/htmlnews/2005/09/07/662140.htm";
imgTz[3]="煤變油成新一輪資源浪費?";
imgUrl[4]="http://www.icxo.com/images/focus/shandong.jpg";
imgLink[4]="http://finance.icxo.com/htmlnews/2005/09/05/660108.htm";
imgTz[4]="山東高耗能GDP躍進難再現";
var imgPre=new Array();
for (i=1;i<8;i++)
{
        imgPre[i]=new Image();
    imgPre[i].src=imgUrl[i];
}
function setTransition()
{
        if (document.all)
        {
                imgUrlrotator.filters.revealTrans.Transition=23;//Math.floor(Math.random()*23)
            imgUrlrotator.filters.revealTrans.apply();
        }
}
function playTransition()
{
if (document.all)
imgUrlrotator.filters.revealTrans.play()
}
function nextAd(toNum)
{
        if(adNum<imgUrl.length-1)
        adNum++ ;
        else
        adNum=1;
   if(toNum!=null) adNum=toNum;
   setTransition();
document.images.imgUrlrotator.src=imgUrl[adNum];
document.getElementById('linktext').innerHTML=imgTz[adNum];
  document.images.imgUrlrotator.alt='今日頭條:'+imgTz[adNum];
document.getElementById('linktext').innerHTML="<a href="+imgLink[adNum]+" target=_blank class=px14-lh20>"+imgTz[adNum]+"</a>";
playTransition();
checkButton();
if(toNum!=null)
        {toNum=null;theTimer=setTimeout("nextAd()", 7000);}
else
        {theTimer=setTimeout("nextAd()", 7000);}
}
function jump2url()
{
jumpUrl=imgLink[adNum];jumpTarget='_blank';
        if (jumpUrl != '')
        {                if (jumpTarget != '')
            window.open(jumpUrl,jumpTarget);
                else location.href=jumpUrl;
   }
}
function displayStatusMsg()
{
        status=imgLink[adNum];
    document.returnValue = true;
}
function checkButton()
{
        for(i=1;i<=imgUrl.length-1;i++)
                {if(i==adNum)
                        //document.getElementById('bt'+i).style.backgroundColor='#00FF00';
                        eval("bt"+i+".style.backgroundColor='#9B0000';bt"+i+".style.color='#FFFFFF';");
                else
                        eval("bt"+i+".style.backgroundColor='#CCCCCC';bt"+i+".style.color='#000000';");
                }
}
function dakularButtons()
{
        if(buttonShow==1)
        {
                switch(buttonPos)
                {
                        case 1:{buttonX=160+20-imgUrl.length*20;buttonY=16;break;}
                        case 2:{buttonX=160+20-imgUrl.length*20;buttonY=125;break;}
                        case 3:{buttonX=imgUrl.length*20-100;buttonY=16;break;}
                        case 4:{buttonX=imgUrl.length*20-100;buttonY=125;break;}
                        default:{buttonX=160+20-imgUrl.length*20;buttonY=16;break;}
                }
                for(i=1;i<=imgUrl.length-1;i++)
                {
                        dakularCode=dakularCode+"<div id='bt"+i+"' style='display:inline; height=14px; width:20px; border:1px solid #000000; background-color:#f7f7f7; color:#000000; font-size:12px; line-height:14px; filter:Alpha(Opacity=50, FinishOpacity=50,Style=2);' align='center' onMouseOver=this.style.backgroundColor='#FFFFFF';this.style.color='#000000';this.style.cursor='hand' onMouseOut=checkButton(); onClick='clearTimeout(theTimer);nextAd("+i+");'>"+i+"</div>";
                }
                dakularCode="<div style='display:inline; position:relative;left:"+buttonX+"px; top:"+buttonY+"px; z-index:1;'>"+dakularCode+"</div>";
                document.write(dakularCode);
        }
}
</script>
<table border="0" cellpadding="0" cellspacing="0" id=newsTable style="position:relative; top:-10px;right:0px; font-size:12px;">
<script language="javascript">dakularButtons();</script><tr><td><a onMouseOver="displayStatusMsg();return document.returnValue;" onMouseOut="status='';" href="javascript:jump2url()"><img style="FILTER: revealTrans(duration=1,transition=18); border:1px solid #000000" src="javascript:nextAd()" width=160 height=150 border=0 name=imgUrlrotator alt="今日頭條"></a></td></tr>
<tr><td bgcolor="#f0f0f0" align="center" style="border-bottom:1px solid #000000; border-left:1px solid #000000;border-right:1px solid #000000;" height="20"><label id="linktext"></label></td></tr>
</table>
<!--begin:圖片輪換結束-->
[/html]

哈哈,問題解決了,感謝兩位高手賜教

奇怪,在本地運行怎麼不行呢?XP說有控件被阻擋了。

成成成,高手們真是爽,兩位高手,受小弟一拜:D




Copyright © 1999-2000 LSLNET.COM. All rights reserved. 藍森林網站 版權所有。 E-mail : webmaster@lslnet.com