您的位置:HBcms宏博内容管理系统 建站经验 正文
 添加时间:2007-05-19 原文发表:2007-05-19 人气:152


代码名称:showModelessDialog弹出窗口代码,弹出窗口源码

代码特点:只兼容ie浏览器,可防止window.open弹出屏蔽

通用使用方法:将下面的代码复制到对应的广告位置,更改广告内容即可(具体细节请看代码里的说明)

HBcms系统使用方法:将下面代码复制到首页的某个自定义标记里(建议复制到默认的index_bottom_part标记里),更改广告内容,更新首页即可

showModelessDialog弹出窗口代码广告源码/代码:

<script language="javascript">
// 要弹出的网址
var hbcms_exitURL="http://www.hbcms.com/";

// 多长时间弹出一次(单位:小时)
// 如果要6分钟弹出一次,可设置为0.1
// 如果要每次访问都弹出,可设置为0
var hbcms_exp_hour=24;

// 弹出窗口宽度
var hbcms_pop_w = 750;

// 弹出窗口高度
var hbcms_pop_h = 600;

function setCookie(name, value, expire) {  
  window.document.cookie = name + "=" + escape(value) + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()));
}

function getCookie(Name) {  
   var search = Name + "=";
   if (window.document.cookie.length > 0) { // if there are any cookies
     offset = window.document.cookie.indexOf(search);
     if (offset != -1) { // if cookie exists
       offset += search.length;          // set index of beginning of value
       end = window.document.cookie.indexOf(";", offset)          // set index of end of cookie value
       if (end == -1)
         end = window.document.cookie.length;
       return unescape(window.document.cookie.substring(offset, end));
     }
   }
   return null;
}

//本代码由宏博cms网站内容管理系统(http://www.hbcms.com/)整理修改

function register(name) {
  var today = new Date();
  var expires = new Date();
  expires.setTime(today.getTime() + 1000*60*60*hbcms_exp_hour);
  setCookie("hbcms_pop_c", name, expires);
}

 


function openWin() {

  var c = getCookie("hbcms_pop_c");
  if (c != null) {
    return;
  }
  register("redoo");
  var featureStr="";
  featureStr="scroll:1;status:1;help:1;resizable:1;dialogWidth:"+hbcms_pop_w+"px; dialogHeight:"+hbcms_pop_h+"px;dialogLeft:0;dialogTop:0;toolbar=yes, menubar=yes, resizable=yes,location=yes,status=yes";
  //featureStr="height=760, width=800, top=0, left=0, toolbar=yes, menubar=yes,resizable=yes,location=yes,status=yes";
  self.focus();
  //var ExitWindow = window.open(exitURL,"redoo", featureStr);
  var ExitWindow = window.showModelessDialog(hbcms_exitURL,"redoo", featureStr);
  ExitWindow.focus(); 
}

openWin();
window.focus()
</script>

本页地址
相关文章

随机浮动代码,随机飘浮代码(兼容firefox,鼠
网页上下浮动对联广告代码, flash对联广告图
网站赢利的三个大前提
站长心得:小网站如何赢利
网站域名对于网站排名的重要性
网页标题Title关键字对于提高网站排名的作用
如何交换反向链接(外部链接)
站长经验:网站布局对访者的友好程度
为什么一定要用开源的CMS?个人站长没有必要
网站倒闭!个人网站的三大危机在哪里?
幻灯片式的网页图片滚动代码,图片滚动代码
微软live搜索优化 (MSN搜索优化 )优化
虚拟主机供应商,网站空间IDC的一些小秘密
网站logo在线设计,免费logo在线制作,在线
如何做往站?回忆一下做往站的心路历程
行业网站的推广计划书
写给个人站长,坚持就是胜利
做什么网站赚钱的问题
域名解析文件hosts文件是什么?如何修改hos
中文网站离不开百度:百度封站,网站即死

相关评论


本文章所属分类:首页 建站经验