求js:凤凰网的右下角的特效

xf198903 2010-08-18 04:38:57
要求通过各大浏览器测试通过的

我今天把凤凰网的那个右下角的特效给抠下来了,
在本地运行它那个特效的时候老是什么flash错误。搞了我一头汗。

为什么会错呢?我郁闷。。。。。。。。。。路径我都没改,什么的。

是不是代码的问题,还是什么啊。求高手解决。。

最好给个特效。。。。

谢谢了
...全文
486 16 打赏 收藏 转发到动态 举报
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
xf198903 2010-08-18
  • 打赏
  • 举报
回复
我就要凤凰网的那个特效。。。

别的不行,不是代码不兼容 就是浏览器不通过。。。

各位拜托了。
wisdonlz 2010-08-18
  • 打赏
  • 举报
回复
[Quote=引用 14 楼 porschev 的回复:]
引用 12 楼 wisdonlz 的回复:
楼主要是它这种效果还是就是它(ps:13天突破技术分四位数,不知道能不能排得上名)


我看如梦每天都突破了四位数
[/Quote]

那没得比了。。。。。额,。
porschev 2010-08-18
  • 打赏
  • 举报
回复
[Quote=引用 12 楼 wisdonlz 的回复:]
楼主要是它这种效果还是就是它(ps:13天突破技术分四位数,不知道能不能排得上名)
[/Quote]

我看如梦每天都突破了四位数
porschev 2010-08-18
  • 打赏
  • 举报
回复
原理大概就是这个样子了。。。主体就是一个settimeout就控制层的显示隐藏。。。

再在JS中控制这个包住object标签的层的位置、大小、等等。。。
wisdonlz 2010-08-18
  • 打赏
  • 举报
回复
楼主要是它这种效果还是就是它(ps:13天突破技术分四位数,不知道能不能排得上名)
porschev 2010-08-18
  • 打赏
  • 举报
回复
把这个FLASH用DIV套着。。比如:这个div叫 flashDiv


<script type="text/javascript">
function showPop(){
var s = document.getElementById("flashDiv").style;
s.display = "block"; //让这个层显示
//这里继续s. 去控制它的大小啊。。。位置啊。。什么的。。
setTimeout('document.getElementById("flashDiv").style.display = "none";',12000); //这里去控制他多久消失
}
</script>


wisdonlz 2010-08-18
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 ppmm2 的回复:]
这个帖子或许可以帮到你。

http://topic.csdn.net/u/20100818/16/31c8a3ae-0e9c-47b6-9261-f3bb57b2efe1.html
[/Quote]

shit ======>>>>www.avmm8.com
xf198903 2010-08-18
  • 打赏
  • 举报
回复
__J:function (sUrl){
this.r=document.documentElement;
this.f=document.createElement("FORM");
this.f.target="_blank";
this.f.method="post";
this.r.insertBefore(this.f,this.r.childNodes[0]);
var ranUrl="?a="+Math.ceil(Math.random()*100);
if(isSafa){
this.f.action=sUrl+ranUrl;
}else {
this.f.action=sUrl;
}
this.f.submit();
},
__G:function (){
this._R.style.display="none";
this._R.innerHTML="";
this._S.style.display="block";
},
GetFlashCommand:function (command,params){
var oThis=this;
if(!params){
params={time:0}
}
if(!params.time){
params.time=-1;
}
this.__K(params.time);
switch(command.toLowerCase()){
case "open":
this.__E("0", params.time);
_('yoiframe').src=this._G;
break;
case "closesmall":
this.__E("-2", params.time);
this._R.style.display = "none";
this._S.style.display = "none";
break;
case "repeat":
this.__E("repeat", params.time);
if(isSafa){
if(0==1){
window.setTimeout(function(){oThis._R.style.display = "block"}, 10);
window.setTimeout(function(){oThis._S.style.display = "block"}, 10);
}else{
window.setTimeout(function(){oThis._R.style.display = "block"}, 10);
window.setTimeout(function(){oThis._S.style.display = "none"}, 10);
}
}else{
if(0==1){
this._R.style.display = "block";
this._S.style.display="block";
}else{
this._R.style.display = "block";
this._S.style.display="none";
}
}
this.__A("crazy_maxdiv", this._C);
break;
case "close":
this.__E("-1", params.time);
if(isSafa){
window.setTimeout(function(){oThis.__G();}, 10);
}else{
this.__G();
}
break;
case "link":
if(params.objID == this._C){
this.__J(this._G);
}else {
this.__J(this._SMALLG);
}
break;
case "pos50":
this.__E("50", params.time);
break;
case "pos100":
this.__E("100", params.time);
break;
case "autoclose":
if(isSafa){
window.setTimeout(function(){oThis.__G();}, 10);
}else{
this.__G();
}
break;
}
},
__H:function (name,value,expires,domain){
document.cookie=name+"="+escape(value)+((expires)?";expires="+expires.toGMTString():"")+((domain)?";domain="+domain:"");
},
__I:function (name){
var arr=document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
if(arr!=null)return unescape(arr[2]);
return null;
},
Init:function (){
var oThis=this;
var _d=document.compatMode=="BackCompat"?dou=document.body:dou=document.documentElement;
if(Sysie6.ie=="6.0"){
this._fixMaxContainer=Bind(this,
function (){
this.__B();
});
this._fixMinContainer=Bind(this,
function (){
this.__F();
})
}
this._N=(this._N=="")?"":("."+this._N);
var _T=this.__I("crazy_E234BB7C_cookie_time_sign");
var _U=0;
_U=this.__I("crazy_E234BB7C_cookie_count_sign");
if(_U==null){
this.__H("crazy_E234BB7C_cookie_count_sign","1",this._Q,this._N);
}else if(_T==null){
_U=Number(_U)+1;
this.__H("crazy_E234BB7C_cookie_count_sign",_U,this._Q,this._N);
}
this.__D();
if(0==1){
this._S.style.display="block";
}else{
this._S.style.display="none";
}
this.__C();
if((this._K==0)&&(_T==null)){
this.__A("crazy_maxdiv", this._C, "theLinkSign");
this.__H("crazy_E234BB7C_cookie_time_sign","1",this._J,this._N);
}else {
if((_U<=this._K)&&(_T==null)){
this.__A("crazy_maxdiv", this._C, "theLinkSign");
this.__H("crazy_E234BB7C_cookie_time_sign","1",this._J,this._N);
}else {
this.__G();
}
}
}
};
var yoyi_focus=new YoYiFocus();
yoyi_focus.Init();
xf198903 2010-08-18
  • 打赏
  • 举报
回复
__C:function (){
document.write("<img id='focus_log_img' style='width:0px;height:0px' />");
document.write("<div id='crazy_maxdiv' style='width:"+769+"px;height:"+500+"px;z-index:12299;overflow:hidden;'></div>");
this._R=_("crazy_maxdiv");
var oThis=this;
this._R.style.position=(!(Sysie6.ie=="6.0"))?"fixed":"absolute";
if(!!(Sysie6.ie=="6.0")){
window.setInterval(function (){
oThis.__B();
},
10);
}else {
if(1==0){
if(1==1){
this._R.style.top =(dou.clientHeight - parseInt(500)) / 2 + "px";
}else{
this._R.style.position="absolute";
this._R.style.top =(dou.clientHeight - parseInt(500)) / 2 + "px";
}

this._R.style.left = dou.scrollLeft + (dou.clientWidth - parseInt(769)) / 2 + "px";
}else{
if(1==1){
this._R.style.top = (80)+ "px";
}else{
this._R.style.position="absolute";
this._R.style.top = (80)+ "px";
}
this._R.style.left = dou.scrollLeft + (dou.clientWidth - parseInt(769)) / 2 + "px";
}
}

},
__D:function (){

document.write("<div id='crazy_mindiv' style='width:"+25+"px;height:"+150+"px;z-index:12299;overflow:hidden;'></div>");
this._S=_("crazy_mindiv");
var oThis=this;
this.__A("crazy_mindiv",this._F);
this._S.style.position=!(Sysie6.ie=="6.0")?"fixed":"absolute";
switch(this._H[0][0]){
case 1:
this._S.style.right=parseInt(this._H[0][1])+"px";
break;
case 0:
this._S.style.left=parseInt(this._H[0][1])+"px";
break;
default:
this._S.style.right="0px";
}
switch(this._H[1][0]){
case 1:
this._S.style.top=parseInt(this._H[1][1])+"px";
break;
case 0:
this._S.style.bottom=parseInt(this._H[1][1])+"px";
break;
default:
this._S.style.top="0px";
}
if(Sysie6.ie=="6.0"){
window.setInterval(oThis._fixMinContainer,10);
}
},
__E:function (sche,datatime){
this._I = "http://amps.yoyi.com.cn/amp/PlayAd?aid=E234BB7C&mid=100816-citizen-750x500&aps="+sche+"&tsp="+ datatime;
_("focus_log_img").src=this._I;
},
__K:function (datatime){
this._G = "http://amps.yoyi.com.cn/amp/ClickAd?aid=E234BB7C&mid=100816-citizen-750x500&tsp="+datatime+"&turl=http%3A%2F%2Fe.miaozhen.com%2Fr.gif%3F%255Ek%3D885%255Ep%3D3Uk0%255Eo%3Dhttp%3A%2F%2Fambassador.citizen.com.cn%2F";
this._SMALLG = "http://amps.yoyi.com.cn/amp/ClickAd?aid=E234BB7C&mid=100816-citizen-750x500&tsp=" + datatime + "&turl=http%3A%2F%2Fe.miaozhen.com%2Fr.gif%3F%255Ek%3D885%255Ep%3D3Uk0%255Eo%3Dhttp%3A%2F%2Fambassador.citizen.com.cn%2F";
},
__F:function (){
if(this._H[1][0]){
this.StartPoint=parseInt(this._S.style.top,10);
this.EndPoint=dou.scrollTop+this._H[1][1];
if(this.StartPoint!=this.EndPoint){
this.ScrollAmount=Math.abs(this.EndPoint-this.StartPoint);
this._S.style.top=parseInt(this._S.style.top,10)+((this.EndPoint<this.StartPoint)?-this.ScrollAmount:this.ScrollAmount)+"px";
}
}else {
this._S.style.top=(dou.clientHeight+dou.scrollTop-this._S.offsetHeight-this._H[1][1])+"px";
if(this._H[0][0]==1){
this._S.style.left=(dou.scrollLeft+dou.clientWidth-this._S.offsetWidth-this._H[0][1])+"px";
}else {
this._S.style.left=(dou.scrollLeft+this._H[0][1])+"px";
}
}
},
xf198903 2010-08-18
  • 打赏
  • 举报
回复
displayAd.js:代码:

var yoyiisIE=(document.all)?true:false;
var Sysie6 = {};
var uaie6 = navigator.userAgent.toLowerCase();
var sie6;
(sie6 = uaie6.match(/msie ([\d.]+)/)) ? Sysie6.ie = sie6[1] : 0;
var isSafa=/Safari/i.test(navigator.userAgent)?true:false;
var isMoz=false;
if(document.getBoxObjectFor){
isMoz=/firefox\\\\\/2/i.test(navigator.userAgent)?true:false;
}
var _=function (sId){
return "string"==typeof(sId)?document.getElementById(sId):sId;
};
var Bind=function (object,fun){
var args=Array.prototype.slice.call(arguments).slice(2);
return function (){
return fun.apply(object,args.concat(Array.prototype.slice.call(arguments)));
}
};
function addEventHandler(oTarget,sEventType,fnHandler){
if(oTarget.addEventListener){
oTarget.addEventListener(sEventType,fnHandler,false);
}else if(oTarget.attachEvent){
oTarget.attachEvent("on"+sEventType,fnHandler);
}else {
oTarget["on"+sEventType]=fnHandler;
}
};
var YoYiFocus=function (){
this._C="http://img.ifeng.com/tres/recommend/cpro/yoyi/2010/07/citizen/100816-citizen-750x500.swf";
this._F="http://img.ifeng.com/tres/recommend/cpro/yoyi/2010/07/citizen/100816-citizen-25x150.swf";
this._G=null;
this._SMALLG=null;
this._H=[[1,0],[0,310]];
this._I=null;
this._J=new Date((new Date()).getTime()+0*60000);
this._K=2;
this._L=0;
this._M=Math.floor(Math.random()*(101));
this._N="";
this._Q=new Date();
this._Q.setHours(this._Q.getHours()+24);
this.isBound=false;
};
YoYiFocus.prototype={
__A:function (elm,url,sign){
if(_(elm)){
var str="";
if(yoyiisIE){
str+='<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" WIDTH="100%" HEIGHT="100%" ALIGN="" id="oflash">';
str+='<PARAM NAME="movie" VALUE="'+url+'"/>';
str+='<PARAM NAME="quality" VALUE="high"/>';
str+='<PARAM NAME="loop" VALUE="false"/>';
str+='<PARAM NAME="wmode" VALUE="transparent"/>';
str+='<PARAM NAME="allowscriptaccess" VALUE="always"/>';
str+='<PARAM NAME="flashvars" VALUE="jsFunName=yoyi_focus.GetFlashCommand"/>';
str+='</OBJECT>';
if(Sysie6.ie=="6.0"){
str+='<iframe style="position:absolute;top:0;left:0;width:100%;height:100%;z-index:-1;filter:alpha(opacity=0);"></iframe>';
}
}else {
str+='<EMBED NAME="videofm" src="'+url+'" flashvars="jsFunName=yoyi_focus.GetFlashCommand" swLiveConnect="true" quality="high" z-index="13000" loop="false" allowscriptaccess="always" wmode="transparent" WIDTH="100%" HEIGHT="100%" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>';
}
if(sign){
if(this._L>this._M){
var oiframe=document.createElement('iframe');
oiframe.style.width="0px";
oiframe.style.height="0px";
oiframe.style.border="0px";
oiframe.id="yoiframe";
document.body.appendChild(oiframe);
}
}
_(elm).innerHTML=str;
}
},
__B:function (){
if(1==0){
if(1==1){
this._R.style.top = dou.scrollTop + (dou.clientHeight - parseInt(500)) / 2 + "px";
}else{
this._R.style.top =(dou.clientHeight - parseInt(500)) / 2 + "px";
}
this._R.style.left = dou.scrollLeft + (dou.clientWidth - parseInt(769)) / 2 + "px";
}else{
if(1==1){
this._R.style.top = (dou.scrollTop +80)+ "px";
}else{
this._R.style.top = (80)+ "px";
}
this._R.style.left = dou.scrollLeft + (dou.clientWidth - parseInt(769)) / 2 + "px";
}
},
xf198903 2010-08-18
  • 打赏
  • 举报
回复
这是我搞下来的代码


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>凤凰网</TITLE>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
</HEAD>
<BODY>
<SCRIPT type=text/javascript src="displayAd.js"></SCRIPT>
</BODY></HTML>
xf198903 2010-08-18
  • 打赏
  • 举报
回复
是啊最右边的
sardineany 2010-08-18
  • 打赏
  • 举报
回复
什么特效?FLASH的关闭和打开?
porschev 2010-08-18
  • 打赏
  • 举报
回复
右下角没什么特效啊。
xf198903 2010-08-18
  • 打赏
  • 举报
回复
http://www.ifeng.com/

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧