Tag Archives: Firefox

IE中的event与Firefox中的e

IE和Firefox在对Javascript的解释方式中有一些差异,在这做个记号。 IE Firefox event.keyCode event.which event.srcElement event.target window.event.returnValue=false e.preventDetfault() 标签:Firefox, IE, Javascript

让firefox将未显示的图片用占位符代替

默认情况下,如果网页中图片路径出错导致未找到图片时,IE会显示一个小红叉,而Firefox则不会显示任何东西,这样给调试带来了一些麻烦,还好Firefox强大的定制性让我们可以通过小小的修改达到类似IE的样子。 具体如下: 打开C:\Users\用户名\AppData\Roaming\Mozilla\Firefox\Profiles\(不确定的字符串).default\chrome\(此路径为Win7下的,XP的应该在Application下) 新建userContent.css文件,将以下内容添加进去,重启Firefox即可。  /* *显示缺失图像占位符 */ @-moz-document url-prefix(http), url-prefix(file) { img:-moz-broken { -moz-force-broken-image-icon: 1 !important; width: 24px; height: 24px; } } 标签:Firefox, 图片占位符

IE6、7、8与Firefox的CSS Hack

selector{ property:value; /* 所有浏览器 */ property:value\9; /* 所有IE浏览器 */ +property:value; /* IE7 */ _property:value; /* IE6 */ } 如果可能的话,尽量去避免使用Hack。 标签:CSS Hack, Firefox, IE

兼容IE和Firefox的点击复制Javascript代码

不多说,直接贴代码。 <script type="text/javascript"> function copyCode(id){     var testCode=document.getElementById(id).value;     if(copy2Clipboard(testCode)!=false){         alert("生成的代码已经复制到粘贴板,你可以使用Ctrl+V 贴到需要的地方去了哦!  ");     } } copy2Clipboard=function(txt){     if(window.clipboardData){         window.clipboardData.clearData();         window.clipboardData.setData("Text",txt);     }     else if(navigator.userAgent.indexOf("Opera")!=-1){         window.location=txt;     }     else if(window.netscape){         try{             netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");         }         catch(e){         [...]

让Firefox默认显示滚动条

Firefox在默认状态下,如果内容不超过一屏,纵向滚动条是不显示的,这点与IE不同,个人感觉不是很爽,尤其是当某些页面本身没有一屏,但通过点击某个按钮让其他隐藏的内容显示出来后超过一屏的话,会感觉整个网页有一个小小的平移。通过下面的代码可以让Firefox默认显示滚动条,使用Firefox的专用属性: html { overflow:-moz-scrollbars-vertical; } 标签:Firefox, 滚动条

第 1 页 / 共 1 页1