网站地图
首页
php教程
asp.net教程
手机开发
css教程
网页制作
办公数码
jsp教程
asp教程
ps教程
当前位置:
编程学习网
>>
办公数码
>
浏览器
> >
【js浏览器兼容】js兼容多钟浏览tab切换代码
【js浏览器兼容】js兼容多钟浏览tab切换代码
发布时间:2018-01-08
【www.gdgbn.com--浏览器】
提示:您可以先修改部分代码再运行
把如下代码加入区域中 <script language="JavaScript" type="text/javascript"> function lib_bwcheck(){ //Browsercheck (needed) this.ver=navigator.appVersion this.agent=navigator.userAgent this.dom=document.getElementById?1:0 this.opera5=this.agent.indexOf("Opera 5")>-1 this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0; this.ie4=(document.all && !this.dom && !this.opera5)?1:0; this.ie=this.ie4||this.ie5||this.ie6 this.mac=this.agent.indexOf("Mac")>-1 this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; this.ns4=(document.layers && !this.dom)?1:0; this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5) return this } var bw=new lib_bwcheck() if(document.layers){ //NS4 resize fix... scrX= innerWidth; scrY= innerHeight; onresize= function(){if(scrX!= innerWidth || scrY!= innerHeight){history.go(0)} } } /**** Variables to set ****/ msgFont= "arial,helvetiva" // The font for the message msgFontSize= 12 // Set the fontSize in px msgFontColor="#000000" // Set the fontColor msgWidth= "300" // Set the width of the messageblock here for netscape 4 //Set the text you want to display on mouseover here. messages=new Array() messages[0]="" //This is the default text that appears when you mouse out. messages[1]="这里是链接一的说明内容" messages[2]="这里是链接二的说明内容" messages[3]="This link however, nr3, isn"t that good..." messages[4]="Maybe you should try this one?
I"ll write some more text to show that it wraps correctly to several lines." messages[5]="这里是链接五的说明内容" messages[6]="Later all.." /******************************************************************************** You don"t have to change anything below this ********************************************************************************/ //ChangeText object constructor. function makeChangeTextObj(obj){ this.css = bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?document.layers[obj]:0; this.writeref = bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?document.layers[obj].document:0; this.writeIt = b_writeIt; } function b_writeIt(text,num){ if (bw.ns4){ this.writeref.write(text) this.writeref.close() } else this.writeref.innerHTML = messages[num] } //The mouoseover function. Calls the writeIt method to write the text to the div. function changeText(num){ if(bw.bw) oMessage.writeIt(""+messages[num]+"", num) } //The init function. Calls the object constructor and initiates some properties. function changeTextInit(){ //Fixing the browsercheck for opera... this can be removed if the browsercheck has been updated!! bw.opera5 = (navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?true:false if (bw.opera5) bw.ns6 = 0 oMessage = new makeChangeTextObj("divMessage") oLinks = new makeChangeTextObj("divLinks") //Setting the style properties of the text layer. if(bw.dom || bw.ie4){ with(oMessage.writeref.style){fontFamily=msgFont; fontSize=msgFontSize+"px"; color=msgFontColor} } //Both layers are hidden by default to prevent users from mousing over them and creating errors while the page loads. oMessage.css.visibility= "visible" oLinks.css.visibility= "visible" } //If the browser is ok, the init function is called on pageload. if (bw.bw) onload = changeTextInit </script> 链接一 链接二 链接三 链接四 链接五 链接六
提示:您可以先修改部分代码再运行
本文来源:
http://www.gdgbn.com/bangongshuma/20990/
上一篇:
json|js 兼容多浏览器复制内容代码
下一篇:
【仿腾讯弹出层效果兼容多浏览器】仿腾讯弹出层效果(兼容多浏览器)
相关推荐
[免费个人简历模板下载]免费个人主页空间110mb/php/mysql/15G
会向上滚动的纸筒|带链接向上滚动字幕代码
js根据id获取值_js根据中英验证用户名提示
【ps制作立体相册效果图】ps制作立体相册效果照片
[js城市地区二级联动插件]js城市地区二级联动菜单
免费100m流量_免费100mb asp/asp.net/php/mysql网页空间
json|js 在按钮上定时显示不同的链接
[json]js 判断是否是Email 大小写字母 数字表达式
[探探美女照片]美女照片-09年最最美的非主流美女
[简单js代码下载]简单js代码 设置cookie,日期,创建 dom代码
网友关注
[动态图片制作特效]图片特效taobal新闻图片幻灯切换效果
网页特效代码_网页特效不断闪动的链接
【js删除字符串空格函数是】js删除字符串空格函数
【公外部网站】防止网站外部调用js,php方法
【兼容ie6】兼容ie6,7,8,forfire图片载入等待效果
网页特效代码|网页特效滚动链接效果
丹麦最性感男演员_2009年最性感美女照片
【js日期格式化】js全面日期判断与显示函数
json|js 房产税费计算器代码
兼容ie7吗_兼容IE7,ie8,foxfir日期控件
热门标签
最新浏览器
浏览器
phpstudy_php cookies 删除,赋值方法
浏览器
ie60|IE6究竟支不支持!important分析
浏览器
简单的可行性报告 范文_简单的可见即所得的CSS编辑器
浏览器
[css超出部分省略号]css dispay:inline-block在不同浏览器用法分析
浏览器
[ie60]ie6 position约对定位错位解决办法
浏览器
css超出部分省略号|css IE6 position:fixed (固定定位)通过position:absolute的解决方案
浏览器
css圆角背景与三角形|CSS圆角背景与三角形实现技巧
浏览器
javascript学习指南|javascript 浏览器类型及版本信息检测代码
浏览器
利用病毒|利用bindEvent() unBindEvent()检测用户浏览器类型
浏览器
将百度设为首页桌面|设为首页与添加收藏夹代码【兼容多浏览器】
浏览器热门文章
浏览器
【仿腾讯弹出层效果兼容多浏览器】仿腾讯弹出层效果(兼容多浏览器)
浏览器
[json]js 兼容ie6,7,8浏览器漂亮柱状统计图
浏览器
兼容ie6|兼容ie6,ie7,firfox的文字不间断向上滚动特效代码
浏览器
js判断浏览器类型|js检测用户浏览器类型
浏览器
[google 翻译]Google Analytics 的事件跟踪开始支持自定义字段
浏览器
[浏览器兼容性问题 js]js获取浏览器相关信息
浏览器
[js限制同一浏览器下只能打开网页]js限制同一浏览器下只能打开同一网站一页面
浏览器
[google 翻译]Google AdSense的六个优化技巧与被封原因分析
浏览器
json_js 浏览器环境检查代码
浏览器
phpstudy|php 模拟 post与浏览器请求数据
声明:本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
Copyright©2006-2019 编程学习网 www.gdgbn.com 版权所有