BBcode hiệu ứng logo bay
Diễn Đàn Dành Cho Teen :: ²♥² zZz __Internet - Blog - Web - 4rum__zZz ²♥² :: Tổng hợp một số BBCode hay
Trang 1 trong tổng số 1 trang
BBcode hiệu ứng logo bay
Mã Html thay thế
- Code:
<HTML><HEAD><TITLE>{--} Javascript - LOGO HIDE & SHOW - HVF - hiencam.vnbb.com</TITLE>
<META content="text/html; charset=UTF-8" http-equiv=Content-Type>
<script>
if(!window.SH_Effect)
SH_Effect=new Object();
SH_Effect.layerNo=0;
SH_Effect.createElem = function(htmlStr)
{
var elem = null;
if(document.layers)
{
elem=new Layer(2000);
elem.document.open();
elem.document.write(htmlStr);
elem.document.close();
elem.innerHTML = htmlStr;
}
else
if(document.all)
{
var xName = "xLayer" + SH_Effect.layerNo++;
var txt = "<DIV ID='" + xName
+ "' STYLE=\"position:absolute;"
+ "visibility:hidden\">"
+ htmlStr
+ "</DIV>";
document.body.insertAdjacentHTML("BeforeEnd",txt);
elem = document.all[xName];
}
else
if (document.getElementById)
{
var xName="xLayer" + SH_Effect.layerNo++;
var txt = ""
+ "position:absolute;"
+ "visibility:hidden";
var newRange = document.createRange();
elem = document.createElement("DIV");
elem.setAttribute("style",txt);
elem.setAttribute("id", xName);
document.body.appendChild(elem);
newRange.setStartBefore(elem);
strFrag = newRange.createContextualFragment(htmlStr);
elem.appendChild(strFrag);
}
return elem;
}
SH_Effect.Layer = function(newLayer)
{
if(!newLayer)
return;
if(typeof newLayer == "string")
this.elem = SH_Effect.createElem(newLayer);
else
this.elem=newLayer;
if(document.layers)
{
this.images=this.elem.document.images;
this.style = this.elem;
}
else
{
this.images = document.images;
this.style = this.elem.style;
}
}
var ns4 = (navigator.appName.indexOf("Netscape") != -1 && !document.getElementById);
SH_Effect.Layer.prototype.moveTo = function(x,y)
{
this.style.left = x+"px";
this.style.top = y+"px";
}
if(ns4)
SH_Effect.Layer.prototype.moveTo = function(x,y) { this.elem.moveTo(x,y); }
SH_Effect.Layer.prototype.show = function() { this.style.visibility = "visible"; }
SH_Effect.Layer.prototype.hide = function() { this.style.visibility = "hidden"; }
if(ns4)
{
SH_Effect.Layer.prototype.show = function() { this.style.visibility = "show"; }
SH_Effect.Layer.prototype.hide = function() { this.style.visibility = "hide"; }
}
if(document.all)
{
SH_Effect.Layer.prototype.setOpacity = function(pc)
{
if(this.style.filter=="")
this.style.filter="alpha(opacity=100);";
this.elem.filters.alpha.opacity=pc;
}
}
else
SH_Effect.Layer.prototype.setOpacity = function(pc) {return 0;}
SH_Effect.Browser = new Object();
if(navigator.appName.indexOf("Netscape") != -1)
{
SH_Effect.Browser.getCanvasWidth = function() {return innerWidth;}
SH_Effect.Browser.getCanvasHeight = function() {return innerHeight;}
SH_Effect.Browser.getMinX = function() {return(pageXOffset);}
SH_Effect.Browser.getMinY = function() {return(pageYOffset);}
SH_Effect.Browser.getMaxX = function() {return(pageXOffset+innerWidth);}
SH_Effect.Browser.getMaxY = function() {return(pageYOffset+innerHeight);}
}
else if(document.all)
{
SH_Effect.Browser.getCanvasWidth = function() {return document.body.clientWidth;}
SH_Effect.Browser.getCanvasHeight = function() {return document.body.clientHeight;}
SH_Effect.Browser.getMinX = function() {return(document.body.scrollLeft);}
SH_Effect.Browser.getMinY = function() {return(document.body.scrollTop);}
SH_Effect.Browser.getMaxX = function() {
return(document.body.scrollLeft
+document.body.clientWidth);
}
SH_Effect.Browser.getMaxY = function() {
return(document.body.scrollTop
+document.body.clientHeight);
}
}
SH_Effect.Logo = new Object();
SH_Effect.Logo.Logos = new Array();
SH_Effect.Logo.start = function()
{
if(SH_Effect.Logo.theTimer == null)
{
SH_Effect.Logo.theTimer = setTimeout("SH_Effect.Logo.animateAll()", 40);
}
}
SH_Effect.Logo.animateAll = function()
{
SH_Effect.Logo.theTimer = setTimeout("SH_Effect.Logo.animateAll()", 40);
var sp = SH_Effect.Logo.Logos;
var i;
for(i=0 ; i<sp.length ; i++)
{
sp[i].animate();
}
}
SH_Effect.AddLogo = function(img)
{
var myLogo = null;
var htmlStr = "<IMG SRC='"+img+"'>";
myLogo = new SH_Effect.Layer(htmlStr);
myLogo.op = 0;
myLogo.x = Math.random()*SH_Effect.Browser.getMaxX();
myLogo.y = Math.random()*SH_Effect.Browser.getMaxY();
myLogo.dx = 0;
myLogo.dy = 0;
myLogo.w = 30;
myLogo.h = 30;
myLogo.targetX = Math.random()*SH_Effect.Browser.getMaxX();
myLogo.targetY = Math.random()*SH_Effect.Browser.getMaxY();
myLogo.state = "off"
myLogo.animate = SH_Effect.animateLogos;
myLogo.hide();
myLogo.setOpacity(this.op);
myLogo.moveTo(myLogo.x,myLogo.y);
SH_Effect.Logo.Logos[SH_Effect.Logo.Logos.length] = myLogo;
SH_Effect.Logo.start();
}
SH_Effect.animateLogos = function()
{
if(this.state == "off")
{
if(Math.random() > .99)
{
this.state="up";
this.show();
}
}
else if(this.state == "on")
{
if(Math.random() > .98)
this.state="down";
}
else if(this.state == "up")
{
this.op += 2;
this.setOpacity(this.op);
if(this.op==100)
this.state = "on";
}
else if(this.state == "down")
{
this.op -= 2;
if(this.op==0)
{
this.hide();
this.state = "off";
}
else
this.setOpacity(this.op);
}
m = this;
var X = (this.targetX - m.x);
var Y = (this.targetY - m.y);
var len = Math.sqrt(X*X+Y*Y);
if(len < 1) len = 1;
var dx = 20 * (X/len);
var dy = 20 * (Y/len);
var ddx = (dx - this.dx)/10;
var ddy = (dy - this.dy)/10;
this.dx += ddx;
this.dy += ddy;
m.x += this.dx;
m.y += this.dy;
m.moveTo(m.x, m.y);
if(Math.random() >.95 )
{
this.targetX = Math.random()*(SH_Effect.Browser.getCanvasWidth()-150);
this.targetY = Math.random()*(SH_Effect.Browser.getCanvasHeight()+SH_Effect.Browser.getMinY()-150);
}
}
</script>
<script>
function Logo_Effect()
{
if (!document.all&&!document.layers)
return
SH_Effect.AddLogo("{URL}");
SH_Effect.AddLogo("{URL}");
SH_Effect.AddLogo("{URL}");
SH_Effect.AddLogo("{URL}");
}
</script>
</HEAD>
<BODY bgColor=#000000 onload=Logo_Effect() >
</BODY></HTML>
Similar topics
» BBcode hiệu ứng rèm sao lung linh trên banner
» BBcode trang trí logo
» Hiệu ứng nền
» Tạo hiệu ứng cho chuột
» Tạo hiệu ứng cho banner
» BBcode trang trí logo
» Hiệu ứng nền
» Tạo hiệu ứng cho chuột
» Tạo hiệu ứng cho banner
Diễn Đàn Dành Cho Teen :: ²♥² zZz __Internet - Blog - Web - 4rum__zZz ²♥² :: Tổng hợp một số BBCode hay
Trang 1 trong tổng số 1 trang
Permissions in this forum:
Bạn không có quyền trả lời bài viết