悬浮广告代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="/1999/xhtml" lang="">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="zh-CN" />
<meta content="all" name="robots" />
<title>符合web标准且可单独关闭的多幅对联广告 - 网页特效观止-网页特效代码|JsCode.CN|</title>
</head>
<body>
<SCRIPT language="JavaScript">
//符合web标准且可关闭的多幅对联广告
//Modified By 在远方
<!--
lastScrollY = 0;
function heartBeat(){
js漂浮广告代码
用jquery方便又简单,在下载jquery
在<head>标签里添加<script src="jquery-1.7.2.js" type="text/javascript></script>
漂浮的原理是:<div>框架相对定位,浏览器滚动条滚动则触发animate函数
<div id="guanggao">内容</div>
<script type="text/javascript">
$(function(){
$(window).scroll(function () {
$("#guangao").animate(:250 + "px"},{duration:500,queue:false});
});
});
请问 网页两边浮动广告代码div漂浮广告代码怎样写?
<script language="javascript">
function x1()
{
document.getElementById("Layer1").style.pixelTop=document.body.scrollTop+10;
}
window.onscroll=x1;
</script>
浮动广告的代码是多少呀? 谢谢 ,对联广告也行!
把上面这段程序的以下代码换成你的flash地址即可。
/goto.php3?code=youpai-sh47-frduilian>
右侧广告浮动代码。"< DIV id=floater1 style="Z-INDEX: 100; LEFT: 10px; VISIBILITY: visible; WIDTH: 100px; POSITION: absolute; TOP: 160px; height: 100px;" >
左边的东西,可以是图片,表格
< /DIV >
< DIV id=floater style="Z-INDEX: 100; RIGHT: 10px; VISIBILITY: visible; WIDTH: 100px; POSITION: absolute; TOP: 160px; left: 890px;" >
右边的东西,可以是图片,表格
< /DIV >"
把下列代码存成文件包含到网页中就行了
menus.js的代码如下:
self.onError = null;
currentX = currentY = 0;
whichIt = null;
lastScrollX = 0; lastScrollY = 0;
NS = (document.layers) ? 1 : 0;
IE = (document.all) ? 1: 0;
function heartBeat(objectid) {
if(IE) { diffY = document.body.scrollTop; diffX = document.body.scrollLeft; }
if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; }
if(diffY != lastScrollY) {
percent = .1 * (diffY - lastScrollY);
if(percent > 0) percent = Math.ceil(percent);
else percent = Math.floor(percent);
if(IE) {
objectid = objectid.split(";");
for (i = 0; i < objectid.length; i++) eval("document.all."+objectid[i]).style.pixelTop += percent;
}
if(NS) {
objectid = objectid.split(";");
for (i = 0; i < objectid.length; i++) eval("document."+objectid[i]) += percent;
}
lastScrollY = lastScrollY + percent;
}
if(diffX != lastScrollX) {
percent = .1 * (diffX - lastScrollX);
if(percent > 0) percent = Math.ceil(percent);
else percent = Math.floor(percent);
if(IE) {
objectid = objectid.split(";");
for (i = 0; i < objectid.length; i++) eval("document.all."+objectid[i]).style.pixelLeft += percent;
}
if(NS) {
objectid = objectid.split(";");
for (i = 0; i < objectid.length; i++) eval("document."+objectid[i]).left += percent;
}
lastScrollX = lastScrollX + percent;
}
}
if(NS || IE) action = window.setInterval("heartBeat(’floater;floater1’)", 2);