两种漂浮在页面中的广告代码

广告|页面

  效果一:

<!--把下面代码加到<body>区域中-->

<div id="img" style="position:absolute;; left: 27px; top: 1115px">
<a href="http://www.webjx.com" target="_blank"><img src="/UploadPic/2007-7/200777171241320.gif" width="100" height="100" border="0"></a></div>
<script language="javascript">
<!-- Begin
var xPos = 20;
var yPos = document.body.clientHeight;
var step = 1;
var delay = 10;
var height = 0;
var Hoffset = 0;
var Woffset = 0;
var yon = 0;
var xon = 0;
var pause = true;
var interval;
img.style.top = yPos;
function changePos() {
width = document.body.clientWidth;
height = document.body.clientHeight;
Hoffset = img.offsetHeight;
Woffset = img.offsetWidth;
img.style.left = xPos + document.body.scrollLeft;
img.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() {
img.visibility = "visible";
interval = setInterval('changePos()', delay);
}
start();
//  End -->
</script>
<div id="img" style="position:absolute;; left: 27px; top: 1115px"> <a href="http://www.webjx.com" target="_blank"><img src="/UploadPic/2007-7/200777171241320.gif" width="100" height="100" border="0"></a></div><script language="javascript"><!-- Beginvar xPos = 20;var yPos = document.body.clientHeight;var step = 1;var delay = 10; var height = 0;var Hoffset = 0;var Woffset = 0;var yon = 0;var xon = 0;var pause = true;var interval;img.style.top = yPos;function changePos() {width = document.body.clientWidth;height = document.body.clientHeight;Hoffset = img.offsetHeight;Woffset = img.offsetWidth;img.style.left = xPos + document.body.scrollLeft;img.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() {img.visibility = "visible";interval = setInterval('changePos()', delay);}start();// End --></script>

    [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]

  效果二:

<SCRIPT>
var imagepath="/images/zp.gif"
var imagewidth=100 //这两行写图片的大小
var imageheight=100
var speed=2;
var imageclick=http://www.webjx.com //这里写点击图片连接到的地址
var hideafter=0
var isie=0;
if(window.navigator.appName=="Microsoft Internet Explorer"&&window.navigator.appVersion.substring(window.navigator.appVersion.indexOf("MSIE")+5,window.navigator.appVersion.indexOf("MSIE")+8)>=5.5) {
isie=1;
}
else {
isie=0;
}
if(isie){
var preloadit=new Image()
preloadit.src=imagepath
}
function pop() {
if(isie) {
x=x+dx;y=y+dy;
oPopup.show(x, y, imagewidth, imageheight);
if(x+imagewidth+5>screen.width) dx=-dx;
if(y+imageheight+5>screen.height) dy=-dy;
if(x<0) dx=-dx;
if(y<0) dy=-dy;
startani=setTimeout("pop();",50);
}
}
function dismisspopup(){
clearTimeout(startani)
oPopup.hide()
}
function dowhat(){
if (imageclick=="dismiss")
dismisspopup()
else
window.open(imageclick);
}
if(isie) {
var x=0,y=0,dx=speed,dy=speed;
var oPopup = window.createPopup();
var oPopupBody = oPopup.document.body;
oPopupBody.style.cursor="hand"
oPopupBody.innerHTML = '<IMG SRC="'+preloadit.src+'">';
oPopup.document.body.onmouseover=new Function("clearTimeout(startani)")
oPopup.document.body.onmouseout=pop
oPopup.document.body.onclick=dowhat
pop();
if (hideafter>0)
setTimeout("dismisspopup()",hideafter*1000)
}
</SCRIPT>
<SCRIPT> var imagepath="/UploadPic/2007-7/200777171241320.gif" var imagewidth=100 //这两行写图片的大小 var imageheight=100 var speed=2; var imageclick="http://www.webjx.com" //这里写点击图片连接到的地址 var hideafter=0 var isie=0; if(window.navigator.appName=="Microsoft Internet Explorer"&&window.navigator.appVersion.substring(window.navigator.appVersion.indexOf("MSIE")+5,window.navigator.appVersion.indexOf("MSIE")+8)>=5.5) { isie=1; } else { isie=0; } if(isie){ var preloadit=new Image() preloadit.src=imagepath } function pop() { if(isie) { x=x+dx;y=y+dy; oPopup.show(x, y, imagewidth, imageheight); if(x+imagewidth+5>screen.width) dx=-dx; if(y+imageheight+5>screen.height) dy=-dy; if(x<0) dx=-dx; if(y<0) dy=-dy; startani=setTimeout("pop();",50); } } function dismisspopup(){ clearTimeout(startani) oPopup.hide() } function dowhat(){ if (imageclick=="dismiss") dismisspopup() else window.open(imageclick); } if(isie) { var x=0,y=0,dx=speed,dy=speed; var oPopup = window.createPopup(); var oPopupBody = oPopup.document.body; oPopupBody.style.cursor="hand" oPopupBody.innerHTML = '<IMG SRC="'+preloadit.src+'">'; oPopup.document.body.onmouseover=new Function("clearTimeout(startani)") oPopup.document.body.onmouseout=pop oPopup.document.body.onclick=dowhat pop(); if (hideafter>0) setTimeout("dismisspopup()",hideafter*1000) } </SCRIPT>

    [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]

时间: 2024-09-11 15:05:47

两种漂浮在页面中的广告代码的相关文章

两种方法测试spring中的jdbc

两种方法测试spring中的jdbc  JDBC是一个非常基础的数据存取API,spring对其进行简单的封装,  下面以sqlserver中自带的pubs数据库Authors表进行测试.   1):编写Authors.java,其每个对象对应于数据库中的一条记录   package jdbc;public class Authors {   String  lname=null;   String fname=null;   String phone=null;   String addres

谷歌下架两款Chrome插件因其内置广告代码

1月20日,据<华尔街日报>报道,谷歌从Chrome网页应用商店中下架了两款Chrome插件,因为这两款软件违反谷歌服务条款,内置了广告代码. 被移除的两款软件为"Add to Feedly"和"Tweet This Page",这两款应用的用户都不足10万.此前,有用户抱怨称,他们发现这两款软件会推送惹人讨厌的广告,其中有用户将"Add to Feedly"称之为"垃圾邮件",在用户所访问的任意网站上都会冒出广告

VBScript教程 第二课在HTML页面中添加VBscript代码_vbs

VB教程 > 第二课在HTML页面中添加VBscript代码 SCRIPT 元素用于将 VBScript 代码添加到 HTML 页面中. <SCRIPT> 标记 VBScript 代码写在成对的 <SCRIPT> 标记之间.例如,以下代码为一个测试传递日期的过程: <SCRIPT LANGUAGE="VBScript"> <!--Function CanDeliver(Dt)CanDeliver = (CDate(Dt) - Now())

js 刷新页面中的图片代码

js 刷新页面中的图片代码   w=window.open("about:blank","images","scrollable=yes"); w.document.open(); for(i=0;i<document.images.length;i++) w.document.write("<img src='" + document.images[i].src + "' /><br /&g

浏览器如何过滤加密页面中的广告

  简单实用的过滤扩展 为浏览器安装对应的功能扩展,是最常见的广告过滤方法之一,而利用它也可以对HTTPS协议传输的广告进行过滤.现在常见的广告过滤扩展有很多,这里我们来试一试uBlock Origin这款扩展.首先打开谷歌应用商店,搜索查找uBlock关键词,这时你会发现有两个相关的功能扩展.这里推荐大家安装uBlock Origin这个版本,因为这个版本是由原作者进行开发维护的,而uBlock版本则是由其他人进行维护的.当uBlock Origin安装完成后,在谷歌浏览器的工具栏找到该扩展的

FeedSky页面中展示广告内测

今天测试了一下FeedSky正在进行中的页面中的展示广告内测,发现有一些问题. 首先,展示广告使用的是Flash形式显示.据FeedSky自己的介绍,选择将广告以Flash形式展现的原因是国内大部分BSP用户无法发布Javascript代码,不过我测试感觉Flash广告速度比较慢,如果有文字类型的广告或者纯图片格式的就好一些. 另外,广告代码在IE6下似乎有问题,同页面的JavaScript代码都无法正常运行,导致整页显示出现问题. 其次,广告代码似乎和AdSense有冲突,放上了FeedSky

使用 Windows XP 的两种强大的工具在您的代码中检测并堵塞 GDI 泄漏

在以前的一篇文章中,作者设计了一种简单的方法来检测图形设备接口 (GDI) 对象,这些对象并未由 Windows 9x 平台上基于 Win32 的应用程序正确地进行发布.因为有些更新版本的 Windows 需要一种不太相同的 GDI 泄漏方法,作者已经更新了针对那些操作系统的方法.他构建并说明了两种工具,这两种工具旨在检测并消除在 Windows XP.Windows 2000 和 Windows NT 上运行的应用程序中的 GDI 泄漏. 在 Windows 95.Windows 98 和 W

wordpress怎么在文章中插入广告代码

方法比较简单,如下: 文章顶部加广告: 打开"外观-编辑"下的"single.php",查找"<?php the_content(); ?>"代码 在"<?php the_content(); ?>"上面添加以下代码即可,如下所示:    代码如下 复制代码 <div style="padding:0px 10px″> 广告代码 </div> 文章底部插入广告: 代码要

VBScript基础教程之二在HTML页面中添加VBscript代码

vbscript|基础教程|页面 SCRIPT 元素用于将 VBScript 代码添加到 HTML 页面中. <SCRIPT> 标记 VBScript 代码写在成对的 <SCRIPT> 标记之间.例如,以下代码为一个测试传递日期的过程: <SCRIPT LANGUAGE="VBScript"> <!-- Function CanDeliver(Dt) CanDeliver = (CDate(Dt) - Now()) > 2 End Fun