精华区 [关闭][返回]

当前位置:网易精华区>>讨论区精华>>网络专区>>● 网站建设>>盖世神功 — 网站建设技术>>HTML — 做好一个网页不能没有的基础>>DHTML特效>>特效14:浮动的LOGO

主题:特效14:浮动的LOGO
发信人: marsz()
整理人: microant(1999-08-02 12:13:18), 站内信件
实例:浮动的LOGO
适用浏览器:ALL
 
说明:当网页载入时你会看到页面的右下角渐渐出现本站的LOGO,并且它会随着
网页的滚动保持位置不变,并在一段时间后消失。本例提供了四种模式,请选择
你喜欢的使用。
 
效果:
 


第一步:把以下六幅图片拷贝到和本页相同的目录下。

staticlogo.js(在右下角)
///////////////////////////////////////////////////////////////////
/*
modified by mars 1999,  www.joysoft.net
*/
///////////////////////////////////////////////////////////////////

//可编辑以下六步:

// 1) 建立一个116*42的图片

var staticlogo=new Image(116,42)

// 2)根据你的网页更改图片的路径
staticlogo.src="../images/banner-00.gif"

// 3) 更改logo的链接
var logolink="http://www.joysoft.net"

// 4) 更改logo的说明文本
var alttext="飞翔鸟软体驿站"

// 5) 给下面的变量赋值为1使其以淡入方式显示
var fadeintoview=1

/* 6)最后这个变量表示logo被载入显示后多长时间后隐藏, 单位为秒

*/
var visibleduration=12


///////////////////////////不要编辑这些代码/////////////////////////
function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers)
setTimeout("window.onresize=regenerate",400)
}


var fadeset=''
if (fadeintoview)
fadeset="filter:alpha(opacity=0)"

if (document.all)
document.write('<span id="logo" style="'+fadeset+';position:absolute;t
op:100;width:'+staticlogo.width+';height:'+staticlogo.height+'"></span
>')

function bringintoview(){
if (logo.filters.alpha.opacity<=95)
logo.filters.alpha.opacity+=5
else{
clearInterval(viewit)
if (visibleduration!=0)
setTimeout("logo.style.visibility='hidden'",visibleduration*1000)
}
}


function createlogo(){
staticimage=new Layer(100)
staticimage.left=-300
staticimage.top=120
staticimage.document.write('<a href="'+logolink+'"><img src="'+staticl
ogo.src+'" border=0 alt="'+alttext+'">')
staticimage.document.close()
staticimage.visibility="show"
regenerate2()
staticitns()
}

if (document.layers)
window.onload=createlogo;

if (document.all){
w=document.body.clientWidth-logo.style.pixelWidth-5
h=document.body.clientHeight-logo.style.pixelHeight-5
logo.style.left=w
logo.style.top=h
}

function logoit(){
var w2=document.body.scrollLeft+w
var h2=document.body.scrollTop+h
logo.style.left=w2
logo.style.top=h2
}
function logoit2(){
staticimage.left=pageXOffset+window.innerWidth-staticimage.document.wi
dth-15
staticimage.top=pageYOffset+window.innerHeight-staticimage.document.he
ight
}

function insertimage(){
logo.innerHTML='<a href="'+logolink+'"><img src="'+staticlogo.src+'" b
order=0 alt="'+alttext+'">'
if (fadeintoview)
viewit=setInterval("bringintoview()",100)
else{
if (visibleduration!=0)
setTimeout("logo.style.visibility='hidden'",visibleduration*1000)
}
}

if (document.all){
window.onscroll=logoit
window.onresize=new Function("window.location.reload()")
window.onload=insertimage
}


function staticitns(){
setInterval("logoit2()",90)
if (visibleduration!=0)
setTimeout("staticimage.visibility='hide'",visibleduration*1000)
}


staticlogo2.js(在左下角)
///////////////////////////////////////////////////////////////////
/*
modified by mars 1999,  www.joysoft.net
*/
///////////////////////////////////////////////////////////////////

//可编辑以下六步:

// 1) 建立一个116*42的图片

var staticlogo=new Image(116,42)

// 2)根据你的网页更改图片的路径
staticlogo.src="../images/banner-00.gif"

// 3) 更改logo的链接
var logolink="http://www.joysoft.net"

// 4) 更改logo的说明文本
var alttext="飞翔鸟软体驿站"

// 5) 给下面的变量赋值为1使其以淡入方式显示
var fadeintoview=1

/* 6)最后这个变量表示logo被载入显示后多长时间后隐藏, 单位为秒

*/
var visibleduration=12


///////////////////////////不要编辑这些代码/////////////////////////
function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers)
setTimeout("window.onresize=regenerate",400)
}


var fadeset=''
if (fadeintoview)
fadeset="filter:alpha(opacity=0)"

if (document.all)
document.write('<span id="logo" style="'+fadeset+';position:absolute;t
op:100;width:'+staticlogo.width+';height:'+staticlogo.height+'"></span
>')

function bringintoview(){
if (logo.filters.alpha.opacity<=95)
logo.filters.alpha.opacity+=5
else{
clearInterval(viewit)
if (visibleduration!=0)
setTimeout("logo.style.visibility='hidden'",visibleduration*1000)
}
}


function createlogo(){
staticimage=new Layer(100)
staticimage.left=-300
staticimage.top=120
staticimage.document.write('<a href="'+logolink+'"><img src="'+staticl
ogo.src+'" border=0 alt="'+alttext+'">')
staticimage.document.close()
staticimage.visibility="show"
regenerate2()
staticitns()
}

if (document.layers)
window.onload=createlogo;

if (document.all){
w=2
h=document.body.clientHeight-logo.style.pixelHeight-5
logo.style.left=w
logo.style.top=h
}

function logoit(){
var w2=document.body.scrollLeft+w
var h2=document.body.scrollTop+h
logo.style.left=w2
logo.style.top=h2
}
function logoit2(){
staticimage.left=pageXOffset+2
staticimage.top=pageYOffset+window.innerHeight-staticimage.document.he
ight
}

function insertimage(){
logo.innerHTML='<a href="'+logolink+'"><img src="'+staticlogo.src+'" b
order=0 alt="'+alttext+'">'
if (fadeintoview)
viewit=setInterval("bringintoview()",100)
else{
if (visibleduration!=0)
setTimeout("logo.style.visibility='hidden'",visibleduration*1000)
}
}

if (document.all){
window.onscroll=logoit
window.onresize=new Function("window.location.reload()")
window.onload=insertimage
}


function staticitns(){
setInterval("logoit2()",90)
if (visibleduration!=0)
setTimeout("staticimage.visibility='hide'",visibleduration*1000)
}

staticlogo3.js(在左上角)

///////////////////////////////////////////////////////////////////
/*
modified by mars 1999,  www.joysoft.net
*/
///////////////////////////////////////////////////////////////////

//可编辑以下六步:

// 1) 建立一个116*42的图片

var staticlogo=new Image(116,42)

// 2)根据你的网页更改图片的路径
staticlogo.src="../images/banner-00.gif"

// 3) 更改logo的链接
var logolink="http://www.joysoft.net"

// 4) 更改logo的说明文本
var alttext="飞翔鸟软体驿站"

// 5) 给下面的变量赋值为1使其以淡入方式显示
var fadeintoview=1

/* 6)最后这个变量表示logo被载入显示后多长时间后隐藏, 单位为秒

*/
var visibleduration=12


///////////////////////////不要编辑这些代码/////////////////////////
function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers)
setTimeout("window.onresize=regenerate",400)
}

var fadeset=''
if (fadeintoview)
fadeset="filter:alpha(opacity=0)"

if (document.all)
document.write('<span id="logo" style="'+fadeset+';position:absolute;t
op:100;width:'+staticlogo.width+';height:'+staticlogo.height+'"></span
>')

function bringintoview(){
if (logo.filters.alpha.opacity<=95)
logo.filters.alpha.opacity+=5
else{
clearInterval(viewit)
if (visibleduration!=0)
setTimeout("logo.style.visibility='hidden'",visibleduration*1000)
}
}



function createlogo(){
staticimage=new Layer(100)
staticimage.left=-300
staticimage.top=120
staticimage.document.write('<a href="'+logolink+'"><img src="'+staticl
ogo.src+'" border=0 alt="'+alttext+'">')
staticimage.document.close()
staticimage.visibility="show"
regenerate2()
staticitns()
}

if (document.layers)
window.onload=createlogo;

if (document.all){
w=2
h=2
logo.style.left=w
logo.style.top=h
}

function logoit(){
var w2=document.body.scrollLeft+w
var h2=document.body.scrollTop+h
logo.style.left=w2
logo.style.top=h2
}
function logoit2(){
staticimage.left=pageXOffset+2
staticimage.top=pageYOffset+2
}

function insertimage(){
logo.innerHTML='<a href="'+logolink+'"><img src="'+staticlogo.src+'" b
order=0 alt="'+alttext+'">'
if (fadeintoview)
viewit=setInterval("bringintoview()",100)
else{
if (visibleduration!=0)
setTimeout("logo.style.visibility='hidden'",visibleduration*1000)
}
}

if (document.all){
window.onscroll=logoit
window.onresize=new Function("window.location.reload()")
window.onload=insertimage
}


function staticitns(){
setInterval("logoit2()",90)
if (visibleduration!=0)
setTimeout("staticimage.visibility='hide'",visibleduration*1000)
}

staticlogo4.js(在右上角)

///////////////////////////////////////////////////////////////////
/*
modified by mars 1999,  www.joysoft.net
*/
///////////////////////////////////////////////////////////////////

//可编辑以下六步:

// 1) 建立一个116*42的图片

var staticlogo=new Image(116,42)

// 2)根据你的网页更改图片的路径
staticlogo.src="../images/banner-00.gif"

// 3) 更改logo的链接
var logolink="http://www.joysoft.net"

// 4) 更改logo的说明文本
var alttext="飞翔鸟软体驿站"

// 5) 给下面的变量赋值为1使其以淡入方式显示
var fadeintoview=1

/* 6)最后这个变量表示logo被载入显示后多长时间后隐藏, 单位为秒

*/
var visibleduration=12


///////////////////////////不要编辑这些代码/////////////////////////
function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers)
setTimeout("window.onresize=regenerate",400)
}


var fadeset=''
if (fadeintoview)
fadeset="filter:alpha(opacity=0)"

if (document.all)
document.write('<span id="logo" style="'+fadeset+';position:absolute;t
op:100;width:'+staticlogo.width+';height:'+staticlogo.height+'"></span
>')

function bringintoview(){
if (logo.filters.alpha.opacity<=95)
logo.filters.alpha.opacity+=5
else{
clearInterval(viewit)
if (visibleduration!=0)
setTimeout("logo.style.visibility='hidden'",visibleduration*1000)
}
}

function createlogo(){
staticimage=new Layer(100)
staticimage.left=-300
staticimage.top=120
staticimage.document.write('<a href="'+logolink+'"><img src="'+staticl
ogo.src+'" border=0 alt="'+alttext+'">')
staticimage.document.close()
staticimage.visibility="show"
regenerate2()
staticitns()
}

if (document.layers)
window.onload=createlogo;

if (document.all){
w=document.body.clientWidth-logo.style.pixelWidth-5
h=2
logo.style.left=w
logo.style.top=h
}

function logoit(){
var w2=document.body.scrollLeft+w
var h2=document.body.scrollTop+h
logo.style.left=w2
logo.style.top=h2
}
function logoit2(){
staticimage.left=pageXOffset+window.innerWidth-staticimage.document.wi
dth-15
staticimage.top=pageYOffset+2
}

function insertimage(){
logo.innerHTML='<a href="'+logolink+'"><img src="'+staticlogo.src+'" b
order=0 alt="'+alttext+'">'
if (fadeintoview)
viewit=setInterval("bringintoview()",100)
else{
if (visibleduration!=0)
setTimeout("logo.style.visibility='hidden'",visibleduration*1000)
}
}

if (document.all){
window.onscroll=logoit
window.onresize=new Function("window.location.reload()")
window.onload=insertimage
}


function staticitns(){
setInterval("logoit2()",90)
if (visibleduration!=0)
setTimeout("staticimage.visibility='hide'",visibleduration*1000)
}



第二步:将以下代码复制到<body>标记下面的任何地方。



<script src="http://yourdomain.com/staticlogo.js">

///////////////////////////////////////////////////////////////////
/*
modified by mars 1999, www.joysoft.net
*/
///////////////////////////////////////////////////////////////////

</script>

注意:执行完以上步骤后,请用记事本打开适用的js文件,根据文件的提示更改
程序参数,以适合你自己。

--
________________________________________________
欢迎访问飞翔鸟软体驿站: HTTP://JOYSOFT.SOIM.NET
BEST REGUARDS, MARS         MAILTO:[email protected]

※ 来源:.月光软件站 http://www.moon-soft.com.[FROM: 202.106.172.121]

[关闭][返回]