网页好看广告代码(广告的代码)

http://www.itjxue.com  2023-01-26 19:20  来源:未知  点击次数: 

网页广告图片代码

先把这段代码存储为 “float.js”

var delta=0.15

var collection;

function floaters() {

this.items = [];

this.addItem = function(id,x,y,content)

{

document.write('DIV id='+id+' style="Z-INDEX: 10; POSITION: absolute; width:95px; height:190px;left:'+(typeof(x)=='string'?eval(x):x)+';top:'+(typeof(y)=='string'?eval(y):y)+'"'+content+'/DIV');

var newItem = {};

newItem.object = document.getElementById(id);

newItem.x = x;

newItem.y = y;

this.items[this.items.length] = newItem;

}

this.play = function()

{

collection = this.items

setInterval('play()',10);

}

}

function play()

{

for(var i=0;icollection.length;i++)

{

var followObj = collection[i].object;

var followObj_x = (typeof(collection[i].x)=='string'?eval(collection[i].x):collection[i].x);

var followObj_y = (typeof(collection[i].y)=='string'?eval(collection[i].y):collection[i].y);

if(followObj.offsetLeft!=(document.body.scrollLeft+followObj_x)) {

var dx=(document.body.scrollLeft+followObj_x-followObj.offsetLeft)*delta;

dx=(dx0?1:-1)*Math.ceil(Math.abs(dx));

followObj.style.left=followObj.offsetLeft+dx;

}

if(followObj.offsetTop!=(document.body.scrollTop+followObj_y)) {

var dy=(document.body.scrollTop+followObj_y-followObj.offsetTop)*delta;

dy=(dy0?1:-1)*Math.ceil(Math.abs(dy));

followObj.style.top=followObj.offsetTop+dy;

}

followObj.style.display = '';

}

}

function closeAd1(){

followDiv1.style.visibility='hidden';}

function closeAd2(){

followDiv2.style.visibility='hidden';}

var theFloaters = new floaters();

theFloaters.addItem('followDiv1',5,100,'a href=# target=_blankimg src=images/left.jpg border=0/abr- a href=javascript:closeAd1(); class="black"关闭/a -');

theFloaters.addItem('followDiv2','document.body.clientWidth-102',100,'a href=# target=_blankimg src=images/right.jpg border=0/abr- a href=javascript:closeAd2(); class="black"关闭/a -');

theFloaters.play();

然后 就是调用这段代码了

SCRIPT language=JavaScript src="js/float.js"/SCRIPT

SCRIPT language=JavaScript

var ad_float_right_src = "images/left.jpg";

var ad_float_right_url = "images/right.jpg";

var ad_float_right_type = "";

/SCRIPT

这样就可以了

跪求一网站banner广告代码!!!

!--Flash Banner--

script type="text/javascript"

//滚动的图片

var speed=30//速度数值越大速度越慢

var demo2=document.getElementById("demo2");

var demo1=document.getElementById("demo1");

demo2.innerHTML=demo1.innerHTML

function Marquee(){

if(demo.scrollLeft=0)

demo.scrollLeft+=demo2.offsetWidth

else{

demo.scrollLeft--

}

}

var MyMar=setInterval(Marquee,speed)

demo.onmouseover=function() {clearInterval(MyMar)}

demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}

/script

SCRIPT type=text/javascript charset=utf-8 src="/js/xixi.js"/SCRIPT

SCRIPT type=text/javascript charset=utf-8 src="/js/index.js"/SCRIPT

SCRIPT type=text/javascript

(function() {

E.onDOMReady(function() {

//BANNER区域图片数据初始化

var bannerImg = [

{

'title': '泰安鼎诚网络',

'banner': '/images/bn-wsgw.gif',

'dlClass': 'wsgw'

},

{

'title': '泰安网站建设',

'banner': '/images/bn-sfk.gif',

'dlClass': 'sfk'

},

{

'title': '泰安网站改版',

'banner': '/images/bn-txf.gif',

'dlClass': 'txf'

},

{

'title': '马可波罗网',

'banner': '/images/mkbl.jpg',

'dlClass': 'xykhk'

},

{

'title': '泰安网络推广',

'banner': '/images/bn-sdmjf.gif',

'dlClass': 'sdmjf'

},

{

'title': '泰安网站优化',

'banner': '/images/bn-slj.gif',

'dlClass': 'slj'

}

];

new AP.pk.pa.slideshowIndex({banners: '.banner-explain',delay : 10000},bannerImg);

});

})();

/SCRIPT

急需要,求一段网页全屏广告的JS代码.

html

title/title

head

script language="javascript" type="text/javascript"

function closediv()

{

document.getElementById("hidediv").style.visibility="hidden";

}

/script

/head

body onload="setTimeout('closediv()',5000)"

div id="hidediv" style="visibility:visible"ok/div

/body

/html

五秒后关闭层。你试试改下

如何在网页中插入广告代码。

1.创建一个名为“topwindow.html”的web文件。

2. 浮动窗口的对应代码如下: HTML

大小:30;填充-顶部:20px;文本-对齐:左;内边距-左:70像素;线条-高度:40px;背景:url(110.jpg)topcenterno-repeat;宽度:252px;

身高:127px;line-heiht:10px;文本-对齐:居中;字体系列:“微软优雅黑色,宋体,正体,黑色”。

3.颜色:#fafafa;文本的影子:rgba(255255255,0.5)05px6pxrgba(255255255,0.2)1px3px3px;}

4.然后将图中所示的代码添加到主页和之间,标记的SRC属性“FDCK”指向的页面地址浮动窗口。

5.所有上面的代码(包括JS脚本)之间应放置,如下图所示。

6.最后,检查浮动窗口的影响,你会注意到周围的浮动窗口不断移动web页面。当鼠标悬停在它,它停止移动,点击“隐藏”按钮,自动隐藏了浮动窗口。

(责任编辑:IT教学网)

更多

推荐微软认证文章