别人网站飘来飘去的广告图标是怎么做的啊?高分回报! 可以用層css,可以用javascript,也可以用asp,方法很多。你隨便去商業性的網站去找一個有這樣的廣告的網頁,查看其源代碼不就可以得到方法了嗎。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 1) 偷代码的诀窍:到IE的临时文件夹去看看,什么css,html,js,统统逃不出你的手心,把他们拷出来研究即可。2)IFrame用来在网页内部嵌入另一个网页。 用dreamweaver,好像直接支持这个效果,要不就是要到网上down一些附加的插件,反正dreamweaver能实现! 在dreamweaver插入层。并拖放到时间轴上就可以实现动画了。当然,如果你会自己手写Javascript那就自己写吧!还有iFrame也是框架页面,不过它是在一个页面中实现的。相当于<DIV>一样。但现在大家都流行用iFrame了。 <div id="dd" style="position:absolute; left:200px; top:50px; width:70px; height:70px; z-index:50"> <a href="****"><img src="***" border="0"></a></div><div align="center"> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin var xPos = 20; var yPos = document.body.clientHeight; var step = 1; var delay = 30; var height = 0; var Hoffset = 0; var Woffset = 0; var yon = 0; var xon = 0; var pause = true; var interval; dd.style.top = yPos; function changePos() { width = document.body.clientWidth; height = document.body.clientHeight; Hoffset = dd.offsetHeight; Woffset = dd.offsetWidth; dd.style.left = xPos + document.body.scrollLeft; dd.style.top = yPos + document.body.scrollTop; if (yon) { yPos = yPos + step; } else { yPos = yPos - step; } if (yPos < 0) { yon = 1; yPos = 0; } if (yPos >= (height - Hoffset)) { yon = 0; yPos = (height - Hoffset); } if (xon) { xPos = xPos + step; } else { xPos = xPos - step; } if (xPos < 0) { xon = 1; xPos = 0; } if (xPos >= (width - Woffset)) { xon = 0; xPos = (width - Woffset); } } function start() { dd.visibility = "visible"; interval = setInterval('changePos()', delay); } function pause_resume() { if(pause) { clearInterval(interval); pause = false; } else { interval = setInterval('changePos()',delay); pause = true; } } start(); // End --> </script> </div> iFrame为内框架以下为两个飘浮代码,自已分开吧<SCRIPT>var pic="gui.gif";var url="http://www.china-click.com/adclick.asp?id=28";document.ns = navigator.appName == "Netscape"window.screen.width>800 ? imgheight=120:imgheight=120window.screen.width>800 ? imgright=15:imgright=120function threenineload(){ if (navigator.appName == "Netscape") { document.threenine.pageY=pageYOffset+window.innerHeight-imgheight; document.threenine.pageX=imgright; threeninemove(); } else { threenine.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight; threenine.style.right=imgright; threeninemove(); }}function threeninemove(){ if(document.ns) { document.threenine.top=pageYOffset+window.innerHeight-imgheight document.threenine.right=imgright; setTimeout("threeninemove();",80) } else { threenine.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight; threenine.style.right=imgright; setTimeout("threeninemove();",80) }}function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) { if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; } } else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();}MM_reloadPage(true)if (navigator.appName == "Netscape") { document.write("<layer id=threenine top=300 width=64 height=80><a href='"+url+"' target=_blank><img src='" + pic + "' border=0 WIDTH=200 HEIGHT=200></a></layer>"); threenineload()} else { document.write("<div id=threenine style='position: absolute;width:64;top:300;visibility: visible;z-index: 1'><a href='"+url+"' target=_blank><img src='" + pic + "' border=0 WIDTH=200 HEIGHT=200></a></div>"); threenineload()}</SCRIPT><SCRIPT>var brOK=false;var mie=false;var aver=parseInt(navigator.appVersion.substring(0,1));var aname=navigator.appName;var mystop=0;function checkbrOK(){ if(aname.indexOf("Internet Explorer")!=-1) { if(aver>=4) brOK=navigator.javaEnabled(); mie=true; } if(aname.indexOf("Netscape")!=-1) { if(aver>=4) brOK=navigator.javaEnabled(); }}var vmin=2;var vmax=5;var vr=2;var timer1;function Chip(chipname,width,height){ this.named=chipname; this.vx=vmin+vmax*Math.random(); this.vy=vmin+vmax*Math.random(); this.w=width; this.h=height; this.xx=0; this.yy=0; this.timer1=null;}function movechip(chipname){ if(brOK && mystop==0) { eval("chip="+chipname); if(!mie) { pageX=window.pageXOffset; pageW=window.innerWidth; pageY=window.pageYOffset; pageH=window.innerHeight; } else { pageX=window.document.body.scrollLeft; pageW=window.document.body.offsetWidth-8; pageY=window.document.body.scrollTop; pageH=window.document.body.offsetHeight; } chip.xx=chip.xx+chip.vx; chip.yy=chip.yy+chip.vy; chip.vx+=vr*(Math.random()-0.5); chip.vy+=vr*(Math.random()-0.5); if(chip.vx>(vmax+vmin)) chip.vx=(vmax+vmin)*2-chip.vx; if(chip.vx<(-vmax-vmin)) chip.vx=(-vmax-vmin)*2-chip.vx; if(chip.vy>(vmax+vmin)) chip.vy=(vmax+vmin)*2-chip.vy; if(chip.vy<(-vmax-vmin)) chip.vy=(-vmax-vmin)*2-chip.vy; if(chip.xx<=pageX) { chip.xx=pageX; chip.vx=vmin+vmax*Math.random(); } if(chip.xx>=pageX+pageW-chip.w) { chip.xx=pageX+pageW-chip.w; chip.vx=-vmin-vmax*Math.random(); } if(chip.yy<=pageY) { chip.yy=pageY; chip.vy=vmin+vmax*Math.random(); } if(chip.yy>=pageY+pageH-chip.h) { chip.yy=pageY+pageH-chip.h; chip.vy=-vmin-vmax*Math.random(); } if(!mie) { eval('document.'+chip.named+'.top ='+chip.yy); eval('document.'+chip.named+'.left='+chip.xx); } else { eval('document.all.'+chip.named+'.style.pixelLeft='+chip.xx); eval('document.all.'+chip.named+'.style.pixelTop ='+chip.yy); } chip.timer1=setTimeout("movechip('"+chip.named+"')",100); }}function stopme(x){ brOk=true; mystop=x; movechip("tome");}var tome;var chip;function tome(){ checkbrOK(); tome=new Chip("tome",80,80); if(brOK) { movechip("tome"); }}ns4=(document.layers)?true:false;ie4=(document.all)?true:false;function cncover(){ if(ns4){ //document.cnc.left=window.innerWidth/2-400; eval('document.cnc.left=document.'+chip.named+'.left'); eval('document.cnc.top=document.'+chip.named+'.top-15'); document.cnc.visibility="show"; }else if(ie4) { //document.all.cnc.style.left=window.document.body.offsetWidth/2-400; document.all.cnc.style.left=parseInt(document.all.tome.style.left); document.all.cnc.style.top=parseInt(document.all.tome.style.top)-20; document.all.cnc.style.visibility="visible"; stopme(1); }}function cncout(){ if(ns4){ document.cnc.visibility="hide"; }else if(ie4) { document.all.cnc.style.visibility="hidden"; stopme(0); }}document.write("<div id='tome' z-index:+1 style='position:absolute;'><a href='http://61.132.47.35/heima/onlinelhb/index.html' onMouseOver=cncover() onMouseOut=cncout() target='_blank'><img src=gui.gif border=0></a>"+"</div>"+" <div id='cnc' style='position:absolute; visibility:hidden;'>"+" </div>");tome();<!--moving logo 结束--></SCRIPT> 全部都是DHTML动态网页的技术,包括javascript,css,html等网页制作程序,网上有很多的javascript特效的网站,不妨去看看,挺好的! iframe是浮动框架页面,和frame定义有一点点相似!可以放在<div></div>内,也可以单独使用! 祝你好运! 做验证码刷新时,为什么在src的地址中加个时间就不会刷新整个页面 分享:在Javascript程序中查看变量 forin js 中Number()函数精度损失,如何解决 getElementsByName 的问题 js显示struts2 标签的问题 JSP页面中怎么在javascript中连接数据库?以下是我的代码?可JS中取得的数据没有在OPTION中显示,急死我了! 关于一个运算的问题 动网论坛自己加了点东西,运行出错 高分求教:如何用replace替换指定的多个字符??? 妞妞的问题~~~~~~~~` 关于XMLHTTP 接收到数据的中文显示问题? js支持远程通信么?
2)IFrame用来在网页内部嵌入另一个网页。
还有iFrame也是框架页面,不过它是在一个页面中实现的。相当于<DIV>一样。但现在大家都流行用iFrame了。
<a href="****"><img src="***" border="0"></a>
</div>
<div align="center">
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var xPos = 20;
var yPos = document.body.clientHeight;
var step = 1;
var delay = 30;
var height = 0;
var Hoffset = 0;
var Woffset = 0;
var yon = 0;
var xon = 0;
var pause = true;
var interval;
dd.style.top = yPos;
function changePos()
{
width = document.body.clientWidth;
height = document.body.clientHeight;
Hoffset = dd.offsetHeight;
Woffset = dd.offsetWidth;
dd.style.left = xPos + document.body.scrollLeft;
dd.style.top = yPos + document.body.scrollTop;
if (yon)
{
yPos = yPos + step;
}
else
{
yPos = yPos - step;
}
if (yPos < 0)
{
yon = 1;
yPos = 0;
}
if (yPos >= (height - Hoffset))
{
yon = 0;
yPos = (height - Hoffset);
}
if (xon)
{
xPos = xPos + step;
}
else
{
xPos = xPos - step;
}
if (xPos < 0)
{
xon = 1;
xPos = 0;
}
if (xPos >= (width - Woffset))
{
xon = 0;
xPos = (width - Woffset);
}
}
function start()
{
dd.visibility = "visible";
interval = setInterval('changePos()', delay);
}
function pause_resume()
{
if(pause)
{
clearInterval(interval);
pause = false;
}
else
{
interval = setInterval('changePos()',delay);
pause = true;
}
}
start();
// End -->
</script>
</div>
以下为两个飘浮代码,自已分开吧
<SCRIPT>
var pic="gui.gif";
var url="http://www.china-click.com/adclick.asp?id=28";
document.ns = navigator.appName == "Netscape"
window.screen.width>800 ? imgheight=120:imgheight=120
window.screen.width>800 ? imgright=15:imgright=120
function threenineload()
{
if (navigator.appName == "Netscape") {
document.threenine.pageY=pageYOffset+window.innerHeight-imgheight;
document.threenine.pageX=imgright;
threeninemove();
} else {
threenine.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight;
threenine.style.right=imgright;
threeninemove();
}
}
function threeninemove()
{
if(document.ns) {
document.threenine.top=pageYOffset+window.innerHeight-imgheight
document.threenine.right=imgright;
setTimeout("threeninemove();",80)
} else {
threenine.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight;
threenine.style.right=imgright;
setTimeout("threeninemove();",80)
}
}
function MM_reloadPage(init)
{
//reloads the window if Nav4 resized
if (init==true) with (navigator) {
if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth;
document.MM_pgH=innerHeight;
onresize=MM_reloadPage;
}
} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true)
if (navigator.appName == "Netscape") {
document.write("<layer id=threenine top=300 width=64 height=80><a href='"+url+"' target=_blank><img src='" + pic + "' border=0 WIDTH=200 HEIGHT=200></a></layer>");
threenineload()
} else {
document.write("<div id=threenine style='position: absolute;width:64;top:300;visibility: visible;z-index: 1'><a href='"+url+"' target=_blank><img src='" + pic + "' border=0 WIDTH=200 HEIGHT=200></a></div>");
threenineload()
}</SCRIPT>
<SCRIPT>
var brOK=false;
var mie=false;
var aver=parseInt(navigator.appVersion.substring(0,1));
var aname=navigator.appName;
var mystop=0;function checkbrOK()
{
if(aname.indexOf("Internet Explorer")!=-1) {
if(aver>=4) brOK=navigator.javaEnabled();
mie=true;
}
if(aname.indexOf("Netscape")!=-1) {
if(aver>=4) brOK=navigator.javaEnabled();
}
}
var vmin=2;
var vmax=5;
var vr=2;
var timer1;function Chip(chipname,width,height)
{
this.named=chipname;
this.vx=vmin+vmax*Math.random();
this.vy=vmin+vmax*Math.random();
this.w=width;
this.h=height;
this.xx=0;
this.yy=0;
this.timer1=null;
}function movechip(chipname)
{
if(brOK && mystop==0) {
eval("chip="+chipname);
if(!mie) {
pageX=window.pageXOffset;
pageW=window.innerWidth;
pageY=window.pageYOffset;
pageH=window.innerHeight;
} else {
pageX=window.document.body.scrollLeft;
pageW=window.document.body.offsetWidth-8;
pageY=window.document.body.scrollTop;
pageH=window.document.body.offsetHeight;
}
chip.xx=chip.xx+chip.vx;
chip.yy=chip.yy+chip.vy;
chip.vx+=vr*(Math.random()-0.5);
chip.vy+=vr*(Math.random()-0.5);
if(chip.vx>(vmax+vmin)) chip.vx=(vmax+vmin)*2-chip.vx;
if(chip.vx<(-vmax-vmin)) chip.vx=(-vmax-vmin)*2-chip.vx;
if(chip.vy>(vmax+vmin)) chip.vy=(vmax+vmin)*2-chip.vy;
if(chip.vy<(-vmax-vmin)) chip.vy=(-vmax-vmin)*2-chip.vy;
if(chip.xx<=pageX) {
chip.xx=pageX;
chip.vx=vmin+vmax*Math.random();
}
if(chip.xx>=pageX+pageW-chip.w) {
chip.xx=pageX+pageW-chip.w;
chip.vx=-vmin-vmax*Math.random();
}
if(chip.yy<=pageY) {
chip.yy=pageY;
chip.vy=vmin+vmax*Math.random();
}
if(chip.yy>=pageY+pageH-chip.h) {
chip.yy=pageY+pageH-chip.h;
chip.vy=-vmin-vmax*Math.random();
}
if(!mie) {
eval('document.'+chip.named+'.top ='+chip.yy);
eval('document.'+chip.named+'.left='+chip.xx);
} else {
eval('document.all.'+chip.named+'.style.pixelLeft='+chip.xx);
eval('document.all.'+chip.named+'.style.pixelTop ='+chip.yy);
}
chip.timer1=setTimeout("movechip('"+chip.named+"')",100);
}
}
function stopme(x)
{
brOk=true;
mystop=x;
movechip("tome");
}
var tome;
var chip;
function tome()
{
checkbrOK();
tome=new Chip("tome",80,80);
if(brOK) {
movechip("tome");
}
}ns4=(document.layers)?true:false;
ie4=(document.all)?true:false;function cncover()
{
if(ns4){
//document.cnc.left=window.innerWidth/2-400;
eval('document.cnc.left=document.'+chip.named+'.left');
eval('document.cnc.top=document.'+chip.named+'.top-15');
document.cnc.visibility="show";
}else if(ie4) {
//document.all.cnc.style.left=window.document.body.offsetWidth/2-400;
document.all.cnc.style.left=parseInt(document.all.tome.style.left);
document.all.cnc.style.top=parseInt(document.all.tome.style.top)-20;
document.all.cnc.style.visibility="visible";
stopme(1);
}
}function cncout()
{
if(ns4){
document.cnc.visibility="hide";
}else if(ie4) {
document.all.cnc.style.visibility="hidden";
stopme(0);
}
}document.write("<div id='tome' z-index:+1 style='position:absolute;'><a href='http://61.132.47.35/heima/onlinelhb/index.html' onMouseOver=cncover() onMouseOut=cncout() target='_blank'><img src=gui.gif border=0></a>"
+"</div>"
+" <div id='cnc' style='position:absolute; visibility:hidden;'>"
+" </div>");
tome();
<!--moving logo 结束-->
</SCRIPT>