|
效果演示:
http://www.adsensetips.com.cn 顶部,浏览应该没问题!
打开后,在浏览器顶部会有一个模仿IE自带的黄色警告条,比较醒目。
点过以后就不会再出现了,除非客户端删除cookie。
After opening at the top of the browser will have a built-in IE imitation yellow warning, more eye-catching. After the on-off point will not happen again, unless the client to delete cookie.
以下是FIREFOX.JS的代码
- // This function does the actual browser detection
- function writeCookie(name, value, hours)
- {
- var expire = “”;
- if(hours != null)
- {
- expire = new Date((new Date()).getTime() + hours * 3600000);
- expire = “; expires=” + expire.toGMTString();
- }
- document.cookie = name + “=” + escape(value) + expire;
- }
- // Example:
- // alert( readCookie(”myCookie”) );
- function readCookie(name)
- {
- var cookieValue = “”;
- var search = name + “=”;
- if(document.cookie.length > 0)
- {
- offset = document.cookie.indexOf(search);
- if (offset != -1)
- {
- offset += search.length;
- end = document.cookie.indexOf(”;”, offset);
- if (end == -1) end = document.cookie.length;
- cookieValue = unescape(document.cookie.substring(offset, end))
- }
- }
- return cookieValue;
- }
- function hasIE_hasIE() {
- var ua = navigator.userAgent.toLowerCase();
- return ((ua.indexOf(’msie’) != -1) && (ua.indexOf(’opera’) == -1) &&
- (ua.indexOf(’webtv’) == -1) &&
- (location.href.indexOf(’seenIEPage’) == -1));
- }
- function hasIE_showLayer(whichLayer)
- {
- if (document.getElementById)
- {
- var style2 = document.getElementById(whichLayer).style;
- style2.display = “block”;
- }
- else if (document.all)
- {
- var style2 = document.all[whichLayer].style;
- style2.display = “block”;
- }
- else if (document.layers)
- {
- var style2 = document.layers[whichLayer].style;
- style2.display = “block”;
- }
- }
- // Hides and shows sections of the page based on whether or not it’s
- // running in IE
- function hasIE_hideAndShow()
- {
- if (hasIE_hasIE())
- {
- hasIE_showLayer(”hasIE_level1″);
- }
- else{}
- }
- function hasIE_ContinueWithoutFF() {
- if (location.href.indexOf(’?') != -1)
- location.href += ‘&seenIEPage=1′;
- else
- location.href += ‘?seenIEPage=1′;
- }
- function closediv(i) {
- writeCookie(”status”,”showed24″,240);
- document.getElementById(i).style.display=’none’;
- }
- document.write(”<table id=\”hasIE_level1\” style=’display:none;clear:both;line-height:100%;’ height=\”22\” width=\”100%\” cellspacing=0 cellpadding=0 border=0><tr><td><div style=\”background:#FFFFBB; text-align: center; padding:2px 0 3px; border-bottom:1px solid #ffd532;position:absolute; top:0; left:0; width:100%; z-index:100\”><div id=\”iewarning\” style=\”width:19px; float:left;\”><img align=\”absmiddle\” src=\”http://www.adsensetips.com.cn/ad/Firefox/warning.gif\” border=\”0\” /></div><div id=\”closeimg\” style=\”width:19px; float:right;\”><a href=\”javascript:closediv(’hasIE_level1′);\” title=\”关闭提示\”><img src=\”http://www.adsensetips.com.cn/ad/Firefox/close1.gif\” align=\”absmiddle\” border=\”0\” /></a></div><div style=\” margin-top:4px;marign-left:4px;font-size:12px;color:#092E20\”>Found that you are using old bugbear, the IE browser, strongly recommend you the Windows operating system using the most secure browser: <a href=\”http://www.gypop.com/english\” title=\”Download FireFox2.0\” target=\”_blank\”><font color=\”#ee0000\”>Download FireFox2.0</a></font></div></div><div style=\”clear:both\”></div></td></tr></table>”);
- if(document.referrer.indexOf(”hao123″)==-1 && document.referrer.indexOf(”hao222″)==-1)
- {
- if(readCookie(”status”) != “showed24″)
- {
- hasIE_hideAndShow();
- }
- }
复制代码
在页面插入就是了 <script src='路径/firefox.js' language='javascript'></script>
Packaging Download Address : http://www.adsensetips.com.cn/ad/firefox.rar
效果演示:
http://www.adsensetips.com.cn |
|