网站首页 网站套餐 创意网站建设 购物系统 网站推广 网站案例 关于我们
用户网站管理
网站用户名
管理员用户名
密  码
验证码
会员中心
用户名
密  码
站内搜索
搜索内容
搜索类别
友情链接
当前位置:HOME > > 建站技巧
如何给网站加对联广告?

发布时间 2007-05-14

第一,登录到网站管理后台,点击“我的文档”,把对广告所需的图片上传好。点击此处可查看“如何上传图片

第二,找到这张图片右边的“浏览”按钮,单击鼠标右键,选择“属性”(如下图),将网址复制到记事本里(注:单击“开始”菜单/程序/附件/记事本,即可打开记事本)。

第三步:在后台点击网页编辑器的“查看HTML源代码”,把光标定位在最后一行,然后把以下代码粘贴进来。最后将下面紫色的文字说明换成刚才存在记事本里的图片的网址,将红色的文字说明换成要链接的网址,比如点击广告链接到163,就改成www.163.com即可。

对联广告代码如下:

<SCRIPT language=JavaScript>
<!--
 var delta=0.15
 var collection;
 var closeB=false;
function floaters() {
  this.items = [];
  this.addItem = function(id,x,y,content)
      {
     document.write('<DIV id='+id+' style="Z-INDEX: 10; POSITION: absolute;  width:80px; height:60px;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()
  {
   if(screen.width<=648 || closeB)
   {
    for(var i=0;i<collection.length;i++)
    {
     collection[i].object.style.display = 'none';
    }
    return;
   }
   for(var i=0;i<collection.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=(dx>0?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=(dy>0?1:-1)*Math.ceil(Math.abs(dy));
     followObj.style.top=followObj.offsetTop+dy;
     }
    followObj.style.display = '';
   }
  }
  function closeBanner()
  {
   closeB=true;
   return;
  }
 
 var theFloaters  = new floaters();
 //
 theFloaters.addItem('followDiv2',6,30,'<a href=左侧图片要链接的新网页的网址 target=_blank><img src=左侧这张图片本身的网址   border=0></a><br><br><img align=right src="http://www.51rich.net/images/ADclose.gif" border="0" onClick="closeBanner();">');
 theFloaters.addItem('followDiv1','document.body.clientWidth-100',30,'<a href=右侧图片要链接的新网页的网址  target=_blank><img align=right src=右侧这张图片本身的网址   border=0></a>');

 theFloaters.play();
//-->
</SCRIPT>


温馨小提示:顶部区和顶部区,是每个网页都能看到的。如果希望每个页面都能看到对联广告,则把代码放入顶部区或者底部区。如果只想首页才出现对联广告,则把代码放入一区。同理,如果想其它栏目页才看到对联广告,则放入其它栏目的代码区即可。

[ 点击数:] [打印本网页] [关闭本窗口]
 

相关内容
查无记录
备案序号:粤ICP备09024154号 经营许可证号:粤B2-20110704    
  shuangyang All Rights Reserved 双阳网络 @ 版权所有
地址:广东省珠海市香洲人民东路221号西海大厦B座508房  邮编:519071
业务部:13902863191黄生  渠道部:13286001025杨小姐
办公电话:+86-756-2523114(八线)  传真:+86-756-6138114 热线电话:400-602-1321
E-mail:nkhzh@21cn.com  MSN:zhrich@msn.com  业务QQ:11319958  361157784珠海网站制作  渠道:196246882珠海网络推广 
售后服务:982544191珠海网站设计设计  996692650珠海网页设计   
营业执照注册号:440400000184215   公司帐号:珠海双阳网络科技有限公司
开户银行:珠海华润银行金进支行    银行帐号:005201080012093435012
双阳网络常年法律顾问:广东江林律师事务所  林云峰律师   

粤公网安备 44040202000067号

网站管理