整理翻转大圈片

来源:互联网 发布:java电商平台源码 编辑:程序博客网 时间:2024/04/29 22:10

 

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>首页大焦点图-PConline</title>
<style type="text/css">
<!--

@charset "gb2312";
table,td,select,input,div {font-size:12px;}
body { font-size:12px; padding:0; margin:0; height:auto;}
a img {border:0;}
form,input,select,ul,li{margin:0;padding:0;}

-->
</style></head>
<body>
<style type="text/css">
/* 数字按钮框样式 */
#imgTitle {FILTER:ALPHA(opacity=70);position:relative;left:0px;text-align:left;overflow: hidden;}
#imgTitle_up {left:0px;text-align: left; height:1px; width:inherit; }
#imgTitle_down {left:0px;text-align: right; width:inherit; }
/* 图片框样式 */
.imgClass {border: 0px solid #000;}
/* 图片文字框样式 */
#txtFrom {text-align: center;vertical-align: middle;}
/* 数字按钮样式 */
.button {text-decoration: none;padding: 2px 7px;background: #7B7B63;margin: 0px;font: bold 9px sans-serif; border-left:#fff 1px solid;}
a.button, a.button:link, a.button:visited {font-family: sans-serif;text-decoration: none;color:#FFFFFF;background-color: #000000;}
a.button:hover {font-family: sans-serif;text-decoration: none;color:#fff;background:#fff; }
.buttonDiv {background: #000000;height: 1px;width: 21px;float: left;text-align: center; vertical-align: middle;}
/*渐变*/
.trans { width:90px; background-color:#000;filter : progid:DXImageTransform.Microsoft.Alpha(startX=0, startY=0, finishX=100, finishY=100,style=1,opacity=0,finishOpacity=40);}
</style>
<script language="javascript" type="text/javascript">
var imgWidth=282;              //图片宽
var imgHeight=240;             //图片高
var textFromHeight=0;         //焦点字框高度 (单位为px)
var textStyle="f12";           //焦点字class style (不是连接class)
var textLinkStyle="p1"; //焦点字连接class style
var buttonLineOn="#f60";           //button下划线on的颜色
var buttonLineOff="#000";          //button下划线off的颜色
var TimeOut=5000;              //每张图切换时间 (单位毫秒);
var imgUrl=new Array();
var imgLink=new Array();
var imgtext=new Array();
var imgAlt=new Array();
var adNum=0;
//焦点字框高度样式表 开始
document.write('<style type="text/css">');
document.write('#focuseFrom{width:'+(imgWidth+2)+';margin: 0px; padding:0px;height:'+(imgHeight+textFromHeight)+'px; overflow:hidden;}');
document.write('#txtFrom{height:'+textFromHeight+'px;line-height:'+textFromHeight+'px;width:'+imgWidth+'px;overflow:hidden;}');
document.write('#imgTitle{width:'+imgWidth+';top:-'+(textFromHeight+16)+'px;height:18px}');
document.write('</style>');
document.write('<div id="focuseFrom">');
//焦点字框高度样式表 结束


imgUrl[1]='http://www.yocity.cn/hotel_cp/img/pic/top_pic_1.jpg';
imgtext[1]='<A HREF="/hotel_cp/hotel_cp_detail.aspx?hotelid=77" TARGET="_blank" class="'+textLinkStyle+'">广东亚洲国际大酒店</A>';
imgLink[1]='/scene/scene_detail.aspx?sceneid=152';
imgAlt[1]='广东亚洲国际大酒店';

 


imgUrl[2]='/hotel_cp/img/pic/top_pic_2.jpg';
imgtext[2]='<A HREF="/hotel_cp/hotel_cp_detail.aspx?hotelid=16" TARGET="_blank" class="'+textLinkStyle+'">广东新珠江大酒店</A>';
imgLink[2]='/scene/scene_detail.aspx?sceneid=150';
imgAlt[2]='广东新珠江大酒店';


imgUrl[3]='/hotel_cp/img/pic/top_pic_3.jpg';
imgtext[3]='<A HREF="/hotel_cp/hotel_cp_detail.aspx?hotelid=59" TARGET="_blank" class="'+textLinkStyle+'">皇帝酒店</A>';
imgLink[3]='/scene/scene_detail.aspx?sceneid=151';
imgAlt[3]='皇帝酒店';


imgUrl[4]='/hotel_cp/img/pic/top_pic_4.jpg';
imgtext[4]='<A HREF="/hotel_cp/hotel_cp_detail.aspx?hotelid=78" TARGET="_blank" class="'+textLinkStyle+'">东莞明苑大酒店</A>';
imgLink[4]='/scene/scene_detail.aspx?sceneid=149';
imgAlt[4]='东莞明苑大酒店';


function changeimg(n)
{
 adNum=n;
 window.clearInterval(theTimer);
 adNum=adNum-1;
 nextAd();
}
function goUrl(){
window.open(imgLink[adNum],'_blank');
}
//NetScape开始
if (navigator.appName == "Netscape")
{
document.write('<style type="text/css">');
document.write('.buttonDiv{height:4px;width:21px;}');
document.write('</style>');
function nextAd(){
 if(adNum<(imgUrl.length-1))adNum++;
 else adNum=1;
 theTimer=setTimeout("nextAd()", TimeOut);
 document.images.imgInit.src=imgUrl[adNum];
 document.images.imgInit.alt=imgAlt[adNum]; 
    document.getElementById('focustext').innerHTML=imgtext[adNum];
 document.getElementById('imgLink').href=imgLink[adNum];

}
 document.write('<a id="imgLink" href="'+imgLink[1]+'" target=_blank class="p1"><img src="'+imgUrl[1]+'" name="imgInit" width='+imgWidth+' height='+imgHeight+' border=1 alt="'+imgAlt[1]+'" class="imgClass"></a><div id="txtFrom"><span id="focustext" class="'+textStyle+'">'+imgtext[1]+'</span></div>')
 document.write('<div id="imgTitle">');
 document.write('<div id="imgTitle_down">');
//数字按钮代码结束
 document.write('</div>');
 document.write('</div>');
 document.write('</div>');
 nextAd();
}
//NetScape结束
//IE开始
else
{
var count=0;
for (i=1;i<imgUrl.length;i++) {
 if( (imgUrl[i]!="") && (imgLink[i]!="")&&(imgtext[i]!="")&&(imgAlt[i]!="") ) {
  count++;
 } else {
  break;
 }
}
function playTran(){
 if (document.all)
  imgInit.filters.revealTrans.play();  
}
var key=0;
function nextAd(){
 if(adNum<count)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];
 document.images.imgInit.alt=imgAlt[adNum]; 
 document.getElementById('link'+adNum).style.background=buttonLineOn;
 for (var i=1;i<=count;i++)
 {
    if (i!=adNum){document.getElementById('link'+i).style.background=buttonLineOff;}
 } 
    focustext.innerHTML=imgtext[adNum];
 theTimer=setTimeout("nextAd()", TimeOut);
}
document.write('<a target=_self href="javascript:goUrl()"><img style="FILTER: revealTrans(duration=1,transition=5);" src="javascript:nextAd()" width='+imgWidth+' height='+imgHeight+' border=0 vspace="0" name=imgInit class="imgClass"></a>');
document.write('<div id="txtFrom"><span id="focustext" class="'+textStyle+'"></span></div>');
document.write('<div id="imgTitle">');
document.write(' <div id="imgTitle_down"> <a class="trans"></a>');
//数字按钮代码开始
for(var i=1;i<imgUrl.length;i++){document.write('<a id="link'+i+'"  href="javascript:changeimg('+i+')" class="button" style="cursor:hand" title="'+imgAlt[i]+'" onFocus="this.blur()">'+i+'</a>');}
//数字按钮代码结束
document.write('</div>');
document.write('</div>');
document.write('</div>');
}
//IE结束
</script>
</body>
</html>

 

=======================================

 

<!--START:焦点图--><script type="text/javascript">
<!--
var ad_link = '12^45^789'
var focus_width=254
var focus_height=166
var text_height=20
var swf_height = focus_height+text_height

//////////////////////////////

//图片一:
var pic1='http://images.gd.sina.com.cn/u/200703/1174439027_33_1.jpg'
var link1='http://gz.house.sina.com.cn/spt/jiaxi0319/index.html'

//图片二:
var pic2=' http://images.gd.sina.com.cn/u/200703/1174959828_127_1.jpg'
var link2='http://sz.house.sina.com.cn/zt/zs070326/index.html'

//图片三:
var pic3='http://images.gd.sina.com.cn/u/200702/1170319811_123_1.jpg'
var link3='http://han.house.sina.com.cn/cnhfw/about_6.html'

//图片四:
var pic4='http://ad4.sina.com.cn/200703/16/84826_gdhouse-jdtp-3.jpg'
var link4='http://sina.allyes.com/main/adfclick?db=sina&bid=73854,105725,105842&cid=0,0,0&sid=98265&advid=2766&camid=14327&show=ignore&url=http://hjxc.hopson.com.cn/'

//////////////////////
 
var pics=pic1+'|'+pic2+'|'+pic3+'|'+pic4
var links=escape(link1)+'|'+escape(link2)+'|'+escape(link3)+'|'+escape(link4)
var texts=' 加息能抑制广州房价吗| 招商地产发展报告暨2007新产品发布会  | 魅力海南购房游火热报名中 | 华景新城鼎盛风华准现楼热售'


document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="gdfocus.swf"><param name="quality" value="high"><param name="bgcolor" value="#EEEEEE">');
document.write('<param name="menu" value="false">');
document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
document.write('<embed src="auto_ch_005.swf" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');  document.write('</object>');

//-->
</script>
<!--END:焦点图-->

======================================

一般情况下,在其它object中如果不方便使用js变时,就将整个obect用documet.write输出