欢迎您来到网页代码站!
设为首页
加入收藏
留 言 板
精品美文
在线手册
如果您关闭了浏览器的javascript,可能导致页面部分功能无法显示,请开启javascript以便正常浏览本网页。网页代码站(www.webdm.cn)谢谢您的支持!
代码首页
菜单导航
表格相关
表单及按钮
层和布局
计算转换
游戏娱乐
广告代码
图片特效
浏览器相关
日期时间
背景特效
文本链接
按标题搜索
按内容搜索
热搜:
div
css
推荐
js
菜单
广告
flash
TAB
时间
焦点图
布局
按钮
您的当前位置:
网页代码站
>>
广告代码
>> 来自搜狐网首页可伸缩的动画BANNER效果
来自搜狐网首页可伸缩的动画BANNER效果
分类:
广告代码
时间:2010-08-30 点击:
关键词:
JS
|
css
|
网页代码
|
代码
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>来自搜狐网首页可伸缩的动画BANNER效果 - www.webdm.cn</title> <script> if(typeof sas=="undefined")var sas=new Object();if(typeof sas.ued=="undefined")sas.ued=new Object();if(typeof sas.ued.util=="undefined")sas.ued.util=new Object();if(typeof sas.ued.FlashObjectUtil=="undefined")sas.ued.FlashObjectUtil=new Object();sas.ued.FlashObject=function(swf,id,w,h,ver,c,useExpressInstall,quality,xiRedirectUrl,redirectUrl,detectKey){if(!document.createElement||!document.getElementById)return;this.DETECT_KEY=detectKey?detectKey:'detectflash';this.skipDetect=sas.ued.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();this.useExpressInstall=useExpressInstall;if(swf)this.setAttribute('swf',swf);if(id)this.setAttribute('id',id);if(w)this.setAttribute('width',w);if(h)this.setAttribute('height',h);if(ver)this.setAttribute('version',new sas.ued.PlayerVersion(ver.toString().split(".")));this.installedVer=sas.ued.FlashObjectUtil.getPlayerVersion(this.getAttribute('version'),useExpressInstall);if(c)this.addParam('bgcolor',c);var q=quality?quality:'high';this.addParam('quality',q);var xir=(xiRedirectUrl)?xiRedirectUrl:window.location;this.setAttribute('xiRedirectUrl',xir);this.setAttribute('redirectUrl','');if(redirectUrl)this.setAttribute('redirectUrl',redirectUrl)};sas.ued.FlashObject.prototype={setAttribute:function(name,value){this.attributes[name]=value},getAttribute:function(name){return this.attributes[name]},addParam:function(name,value){this.params[name]=value},getParams:function(){return this.params},addVariable:function(name,value){this.variables[name]=value},getVariable:function(name){return this.variables[name]},getVariables:function(){return this.variables},createParamTag:function(n,v){var p=document.createElement('param');p.setAttribute('name',n);p.setAttribute('value',v);return p},getVariablePairs:function(){var variablePairs=new Array();var key;var variables=this.getVariables();for(key in variables){variablePairs.push(key+"="+variables[key])}return variablePairs},getFlashHTML:function(){var flashNode="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall"))this.addVariable("MMplayerType","PlugIn");flashNode='<embed type="application/x-shockwave-flash" src="'+this.getAttribute('swf')+'" width="'+this.getAttribute('width')+'" height="'+this.getAttribute('height')+'"';flashNode+=' id="'+this.getAttribute('id')+'" name="'+this.getAttribute('id')+'" ';var params=this.getParams();for(var key in params){flashNode+=[key]+'="'+params[key]+'" '}var pairs=this.getVariablePairs().join("&");if(pairs.length>0){flashNode+='flashvars="'+pairs+'"'}flashNode+='/>'}else{if(this.getAttribute("doExpressInstall"))this.addVariable("MMplayerType","ActiveX");flashNode='<object id="'+this.getAttribute('id')+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute('width')+'" height="'+this.getAttribute('height')+'">';flashNode+='<param name="movie" value="'+this.getAttribute('swf')+'" />';var params=this.getParams();for(var key in params){flashNode+='<param name="'+key+'" value="'+params[key]+'" />'}var pairs=this.getVariablePairs().join("&");if(pairs.length>0){flashNode+='<param name="flashvars" value="'+pairs+'" />'}flashNode+="</object>"}return flashNode},write:function(elementId){if(this.useExpressInstall){var expressInstallReqVer=new sas.ued.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(expressInstallReqVer)&&!this.installedVer.versionIsValid(this.getAttribute('version'))){this.setAttribute('doExpressInstall',true);this.addVariable("MMredirectURL",escape(this.getAttribute('xiRedirectUrl')));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}}else{this.setAttribute('doExpressInstall',false)}if(this.skipDetect||this.getAttribute('doExpressInstall')||this.installedVer.versionIsValid(this.getAttribute('version'))){var n=(typeof elementId=='string')?document.getElementById(elementId):elementId;n.innerHTML=this.getFlashHTML()}else{if(this.getAttribute('redirectUrl')!=""){document.location.replace(this.getAttribute('redirectUrl'))}}}};sas.ued.FlashObjectUtil.getPlayerVersion=function(reqVer,xiInstall){var PlayerVersion=new sas.ued.PlayerVersion(0,0,0);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){PlayerVersion=new sas.ued.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");for(var i=3;axo!=null;i++){axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);PlayerVersion=new sas.ued.PlayerVersion([i,0,0])}}catch(e){}if(reqVer&&PlayerVersion.major>reqVer.major)return PlayerVersion;if(!reqVer||((reqVer.minor!=0||reqVer.rev!=0)&&PlayerVersion.major==reqVer.major)||PlayerVersion.major!=6||xiInstall){try{PlayerVersion=new sas.ued.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","))}catch(e){}}}return PlayerVersion};sas.ued.PlayerVersion=function(arrVersion){this.major=parseInt(arrVersion[0])||0;this.minor=parseInt(arrVersion[1])||0;this.rev=parseInt(arrVersion[2])||0};sas.ued.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major)return false;if(this.major>fv.major)return true;if(this.minor<fv.minor)return false;if(this.minor>fv.minor)return true;if(this.rev<fv.rev)return false;return true};sas.ued.util={getRequestParameter:function(param){var q=document.location.search||document.location.href.hash;if(q){var startIndex=q.indexOf(param+"=");var endIndex=(q.indexOf("&",startIndex)>-1)?q.indexOf("&",startIndex):q.length;if(q.length>1&&startIndex>-1){return q.substring(q.indexOf("=",startIndex)+1,endIndex)}}return""}};if(Array.prototype.push==null){Array.prototype.push=function(item){this[this.length]=item;return this.length}}var getQueryParamValue=sas.ued.util.getRequestParameter;var sohuFlash=sas.ued.FlashObject; function Cookie(document,name,hours,path,domain,secure){this.$document=document;this.$name=name;this.$expiration=hours?new Date((new Date()).getTime()+hours*3600000):null;this.$path=path?path:null;this.$domain=domain?domain:null;this.$secure=secure;};Cookie.prototype.store=function (){var cookieval="";for(var prop in this){if((prop.charAt(0)=='$')||((typeof this[prop])=='function')) continue;if(cookieval!="") cookieval+='&';cookieval+=prop+':'+escape(this[prop]);}var cookie=this.$name+'='+cookieval;if(this.$expiration)cookie+='; expires='+this.$expiration.toGMTString();if(this.$path) cookie+='; path='+this.$path;if(this.$domain) cookie+='; domain='+this.$domain;if(this.$secure) cookie+='; secure';this.$document.cookie=cookie;};Cookie.prototype.load=function(){var allcookies=this.$document.cookie;if(allcookies=="") return false;var start=allcookies.indexOf(this.$name+'=');if(start==-1) return false;start+=this.$name.length+1;var end=allcookies.indexOf(';',start);if(end==-1) end=allcookies.length;var cookieval=allcookies.substring(start,end);var a=cookieval.split('&');for(var i=0; i<a.length; i++) a[i]=a[i].split(':');for(var i=0; i<a.length; i++) this[a[i][0]]=unescape(a[i][1]);return true;};Cookie.prototype.remove = function(){var cookie;cookie = this.$name + '=';if (this.$path) cookie += '; path=' + this.$path;if (this.$domain) cookie += '; domain=' + this.$domain;cookie += '; expires=Fri, 02-Jan-1970 00:00:00 GMT';this.$document.cookie = cookie;}; </script> </head> <body> <div align="center"> <!-- top_banner --> <table width="760" height="100" border="0" cellpadding="0" cellspacing="0" bgcolor="#F4F4F4"> <tr> <td align="center">网页内容</td> </tr> </table> <div id=lanrentuku style='width:760px;height:32px;position:relative;overflow:hidden;z-index:-1'></div> <SCRIPT language=javascript> var sohuFlash2 = new sohuFlash( "http://www.webdm.cn/images/20100830/banner.swf", "flexDiv", "100%", "100%", "7", "" ); sohuFlash2.addParam( "scale", "noscale" ); sohuFlash2.addParam( "salign", "tl" ); sohuFlash2.addParam( "quality", "high" ); sohuFlash2.addParam( "wmode", "opaque" ); sohuFlash2.addVariable( "clickthru", "http://www.webdm.cn/" ); sohuFlash2.write( "lanrentuku" ); with( document.getElementById( 'lanrentuku' ) ) { if ( navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length ) { addEventListener( "mouseover", function() { style.height = '48pt'; } , false ); addEventListener( "mouseout", function() { style.height = '24pt'; } , false ); } else { attachEvent( "onmouseover", function() { style.height = '64px'; } ); attachEvent( "onmouseout", function() { style.height = '32px'; } ); } } </SCRIPT> </div> <br /> <p><a href="http://www.webdm.cn">网页代码站</a> - 最专业的代码下载网站 - 致力为中国站长提供有质量的代码!</p> </body> </html>
运行代码
全选代码
复制代码
保存代码
友情提示
来自搜狐网首页可伸缩的动画BANNER效果
一、如果您使用的浏览器版本为IE6.0、360浏览器V3.0.8.1版本或者IE的更低版本浏览本页面,建议您升级浏览器至IE7以上,上面的“运行”按钮可能不能用,但您可按以下方式查看。
运行代码方式:
1、点击“复制”按钮;
2、在桌面建立一个txt文档;
3、粘贴复制的代码;
4、最后把txt的扩展名改为“htm”或“html”;
5、完成,打开即可看到效果。
二、如果您使用FireFox或者非IE浏览器,建议您使用IE7以上版本。上面的“复制”按钮失效,请您“全选”,以普通方式复制!
三、某些代码因需加载完Jquery等之类比较大的JS文件,如果您看不到效果,请您刷新页面!
四、某些代码不能完全兼容各浏览器,还请您再次修改才能使用!给您带来的不便!尽请谅解!谢谢您的支持!
来顶一下
上一篇:
JS+TABLE实现水平无缝滚动代码
下一篇:
JS+cookie实现显示访客登陆信息的功能及修改信息功能
JavaScript实现网页右下角弹出窗
QQ在线客服JS代码,自适应漂浮
163网站的一款JS滑屏广告
可以展开、收缩的顶部滑动广告
浮动在网页最上层自动关闭的广
经典的JS对联广告代码
JS+Flash打造的网页右上角拉链广
JS实现页面广告窗口
JS+CSS+DIV自适应高度实用的对联
JS跳球广告代码
问问
|
贴吧
|
查询
|
给我留言
|
精品美文
|
友情链接
| |
本站承接网站开发业务
版权声明
|
广告服务
|
联系我们
|
网站地图
|
关于我们
| |
滇ICP备08101440号
Powered by
网页代码站
(网页即"web" + 代码即"dm" + "cn" = webdm.cn) | 最专业的代码下载网站 - 致力为中国站长提供高质量的代码!