页面右下角广告代码(网页右下角广告弹窗)
admin 发布:2022-12-19 23:51 173
今天给各位分享页面右下角广告代码的知识,其中也会对网页右下角广告弹窗进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!
本文目录一览:
javascript 右下角 广告代码?
HTMLHEAD
TITLE网页特效观止|JsCode.CN|---页面右下角弹出类似QQ或MSN的消息提示/TITLE
SCRIPT language=JavaScript
!--
/**//*
** ==================================================================================================
** 类名:CLASS_MSN_MESSAGE
** 功能:提供类似MSN消息框
** 示例:
---------------------------------------------------------------------------------------------------
//width:层宽度、height:层高度、caption:层的标题、title:题目类型、content:内容、UserID:对应的数据库的ID号
var MSG = new CLASS_MSN_MESSAGE(width,height,caption,title,message,content,UserID){
MSG.show();
---------------------------------------------------------------------------------------------------
** 作者:ttyp
** 邮件:ttyp@21cn.com
** 日期:2005-3-18
** ==================================================================================================
**/
/**//*
* 消息构造
*/
var oPopup = window.createPopup(); //IE5.5+
var windowsUrl="模拟QQ右下角提示窗体.htm";//var windowsUrl=null;//这个是Windows的连接主地址:修改地址
//width:层宽度、height:层高度、caption:层的标题、title:题目类型、content:内容、UserID:对应的数据库的ID号
function CLASS_MSN_MESSAGE(width,height,caption,title,message,content,UserID){
// this.id = id;
this.title = title;
this.caption= caption;
this.message= message;
//this.target = target;
//this.action = action;
this.width = width?width:200;
this.height = height?height:120;
this.timeout= 150;
this.speed = 20;
this.step = 1;
this.right = screen.width -1;
this.bottom = screen.height;
this.left = this.right - this.width;
this.top = this.bottom - this.height;
this.timer = 0;
this.pause = false;
this.close = false;
this.autoHide = true;
contt=content;//内容
IDD=UserID;
}
/**//*
* 隐藏消息方法
*/
CLASS_MSN_MESSAGE.prototype.hide = function(){
if(this.onunload()){
var offset = this.heightthis.bottom-this.top?this.height:this.bottom-this.top;
var me = this;
if(this.timer0){
window.clearInterval(me.timer);
}
var fun = function(){
if(me.pause==false||me.close){
var x = me.left;
var y = 0;
var width = me.width;
var height = 0;
if(me.offset0){
height = me.offset;
}
y = me.bottom - height;
if(y=me.bottom){
window.clearInterval(me.timer);
me.Pop.hide();
} else {
me.offset = me.offset - me.step;
}
me.Pop.show(x,y,width,height);
}
}
this.timer = window.setInterval(fun,this.speed)
}
}
/**//*
* 消息卸载事件,可以重写
*/
CLASS_MSN_MESSAGE.prototype.onunload = function() {
return true;
}
/**//*
* 消息命令事件,要实现自己的连接,请重写它
*
*/
CLASS_MSN_MESSAGE.prototype.oncommand = function(){
//this.close = true;
this.hide();
//获取到ID号
var xID=oPopup.document.getElementById("hiddenID").value;
window.open(windowsUrl+"?id="+xID);//连接到的地址------------------可根据情况自己填写参数-------------------------需要修改
}
/**//*
* 消息显示方法
*/
CLASS_MSN_MESSAGE.prototype.show = function(){
this.Pop = oPopup;
var w = this.width;
var h = this.height;
var str = "DIV style='BORDER-RIGHT: #455690 1px solid; BORDER-TOP: #a6b4cf 1px solid; Z-INDEX: 99999; LEFT: 0px; BORDER-LEFT: #a6b4cf 1px solid; WIDTH: " + w + "px; BORDER-BOTTOM: #455690 1px solid; POSITION: absolute; TOP: 0px; HEIGHT: " + h + "px; BACKGROUND-COLOR: #c9d3f3'"
str += "TABLE style='BORDER-TOP: #ffffff 1px solid; BORDER-LEFT: #ffffff 1px solid' cellSpacing=0 cellPadding=0 width='100%' bgColor=#cfdef4 border=0"
str += "TR"
str += "TD style='FONT-SIZE: 12px;COLOR: #0f2c8c' width=30 height=24/TD"
str += "TD style='PADDING-LEFT: 4px; FONT-WEIGHT: normal; FONT-SIZE: 12px; COLOR: #1f336b; PADDING-TOP: 4px' valign=middle width='100%'" + this.caption + "/TD"
str += "TD style='PADDING-RIGHT: 2px; PADDING-TOP: 2px' valign=middle align=right width=19"
str += "SPAN title=关闭 style='FONT-WEIGHT: bold; FONT-SIZE: 12px; CURSOR: hand; COLOR: red; MARGIN-RIGHT: 4px' id='btSysClose' ×/SPAN/TD"
str += "/TR"
str += "TR"
str += "TD style='PADDING-RIGHT: 1px;PADDING-BOTTOM: 1px' colSpan=3 height=" + (h-28) + ""
str += "DIV style='BORDER-RIGHT: #b9c9ef 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #728eb8 1px solid; PADDING-LEFT: 8px; FONT-SIZE: 12px; PADDING-BOTTOM: 8px; BORDER-LEFT: #728eb8 1px solid; WIDTH: 100%; COLOR: #1f336b; PADDING-TOP: 8px; BORDER-BOTTOM: #b9c9ef 1px solid; HEIGHT: 100%'" + this.title + "BR" //这里的隐藏域用来存字段的id号hiddenID
//这里的btCommand是调用方法onCommand只执行方法体类的Windowns.open地址
str += "DIV style='WORD-BREAK: break-all' align=leftinput type='hidden' name='hiddenID' id='hiddenID' value='"+IDD+"'/A href='javascript:void(0)' hidefocus=false id='btCommand'FONT color=#ff0000【" + this.message + "】/FONT/Abrfont color=blue"+contt+"/font/DIV"//A href='' hidefocus=false id='ommand'
//FONT color=#ff0000"+contt+"/FONT/A/DIV"//这里是连接的地址
str += "/DIV"
str += "/TD"
str += "/TR"
str += "/TABLE"
str += "/DIV"
oPopup.document.body.innerHTML = str;
this.offset = 0;
var me = this;
oPopup.document.body.onmouseover = function(){me.pause=true;}
oPopup.document.body.onmouseout = function(){me.pause=false;}
var fun = function(){
var x = me.left;
var y = 0;
var width = me.width;
var height = me.height;
if(me.offsetme.height){
height = me.height;
} else {
height = me.offset;
}
y = me.bottom - me.offset;
if(y=me.top){
me.timeout--;
if(me.timeout==0){
window.clearInterval(me.timer);
if(me.autoHide){
me.hide();
}
}
} else {
me.offset = me.offset + me.step;
}
me.Pop.show(x,y,width,height);
}
this.timer = window.setInterval(fun,this.speed)
var btClose = oPopup.document.getElementById("btSysClose");
btClose.onclick = function(){
me.close = true;
me.hide();
}
var btCommand = oPopup.document.getElementById("btCommand");
btCommand.onclick = function(){
me.oncommand();
}
}
/**//*
** 设置速度方法
**/
CLASS_MSN_MESSAGE.prototype.speed = function(s){
var t = 10;
try {
t = praseInt(s);
} catch(e){}
this.speed = t;
}
/**//*
** 设置步长方法
**/
CLASS_MSN_MESSAGE.prototype.step = function(s){
var t = 1;
try {
t = praseInt(s);
} catch(e){}
this.step = t;
}
CLASS_MSN_MESSAGE.prototype.rect = function(left,right,top,bottom){
try {
this.left = left !=null?left:this.right-this.width;
this.right = right !=null?right:this.left +this.width;
this.bottom = bottom!=null?(bottomscreen.height?screen.height:bottom):screen.height;
this.top = top !=null?top:this.bottom - this.height;
} catch(e){}
}
var MSG1 = new CLASS_MSN_MESSAGE(200,120,"短消息提示:","您有1封消息","标题:肚子饿了","内容:今天没有吃饭","11111111");
MSG1.rect(null,null,null,screen.height-50);
MSG1.speed = 50;
MSG1.step = 5;
MSG1.show();
//同时两个有闪烁,只能用层代替了,不过层不跨框架
//var MSG2 = new CLASS_MSN_MESSAGE("aa",200,120,"短消息提示:","您有2封消息","好的啊");
// MSG2.rect(100,null,null,screen.height);
// MSG2.show();
//--
/SCRIPT
META content="MSHTML 6.00.2800.1106" name=GENERATOR/HEAD
BODY/BODY/HTML
加点分吧 这么舍不得啊
求一段 广告固定在网页右下角的代码(CSS或JS都行),谢谢!!
script language="javascript"
function repos(x,y){ //x、y分别是你广告框的宽度和高度
layid = document.getElementById("ddiv"); //ddiv的广告框div的id
layid.style.left = (document.documentElement.scrollLeft + document.documentElement.clientWidth - x)+"px";
layid.style.top = (document.documentElement.scrollTop + document.documentElement.clientHeight - y)+"px";
}
/script
这是广告框的css:style="position:absolute; z-index:1; width:175px; height:80px"
然后把上面这个repos(x,y)函数同时用到onload、onscroll、onresize的事件中
求一个右下角的漂浮广告代码?
右下角漂浮广告代码使用方法(一): 将以下代码以**.js文件形式保存,在模板中调用这个js文件即可
(备注该代码的图片大小为250*150 代码里面有参数自己看下就知道了)document.writeln("div id=\"qqaddiv\" style=\"position:absolute; z-index: 100;\" ");
document.writeln("a href=链接地址 target=_blankimg src=图片链接地址 border=0/a");
document.writeln("/div");
var bodyfrm = ( document.compatMode.toLowerCase()=="css1compat" ) ? document.documentElement : document.body;
var adst = document.getElementById("qqaddiv").style;
adst.top = ( bodyfrm.clientHeight - 150 ) + "px";
adst.left = ( bodyfrm.clientWidth - 250 ) + "px";
function moveR() {
adst.top = ( bodyfrm.scrollTop + bodyfrm.clientHeight - 150 ) + "px";
adst.left = ( bodyfrm.scrollLeft + bodyfrm.clientWidth - 250 ) + "px";
}
setInterval("moveR();", 80); 右下角漂浮广告代码使用方法(二): var qq_etewidth = 259;
var qq_eteheight = 158;
var qq_banner_filename = "广告图片链接地址";
var qq_gotoUrl = '广告链接地址';document.write("div id=eteUnionUpFloat style='margin:0px;padding-bottom:300px;z-index: 10;position:absolute;width:"+qq_etewidth+"px;height:"+qq_eteheight+"px;'")
document.write("a href='"+qq_gotoUrl+"' target='_blank'img src='"+qq_banner_filename+"' border='0' style='cursor: hand;' width='"+qq_etewidth+"' height='"+qq_eteheight+"'/a")
document.write("/div")
var bodyfrm = ( document.compatMode.toLowerCase()=="css1compat" ) ? document.documentElement : document.body;
var adst = document.getElementById("eteUnionUpFloat").style;
adst.top = ( bodyfrm.clientHeight - qq_eteheight ) + "px";
adst.left = ( bodyfrm.clientWidth - qq_etewidth ) + "px";
function moveR() {
adst.top = ( bodyfrm.scrollTop + bodyfrm.clientHeight - qq_eteheight ) + "px";
adst.left = ( bodyfrm.scrollLeft + bodyfrm.clientWidth - qq_etewidth ) + "px";
}
var objTimer=setInterval("moveR();", 100);function CloseX(){
adst.display='none';
}function ete_closediv()
{
document.getElementById('eteUnionUpFloat').style.visibility='hidden';
if(objTimer) window.clearInterval(objTimer)
}
关于页面右下角广告代码和网页右下角广告弹窗的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。
版权说明:如非注明,本站文章均为 AH站长 原创,转载请注明出处和附带本文链接;
相关推荐
- 05-19广告网站留电话,广告网站留电话免验证码
- 05-19发布广告的平台免费,广告网站留电话
- 05-19如何做网站,如何做网站网页
- 05-18百度广告推广电话,不需要验证码的广告平台
- 05-18免费网页设计制作网站,免费网页设计软件
- 05-18制作网页一般多少钱,网页制作要多少钱
- 05-17长沙网站制作公司哪家好,长沙网页制作公司
- 05-17免费建网页,怎样免费建立网站
- 05-17做公司网页,做公司网页有什么简单的方法
- 05-17百度网页推广,百度网页推广费用
取消回复欢迎 你 发表评论:
- 标签列表
- 最近发表
- 友情链接