CSS background image flickering bug in IE6 (background image cache problem in IE6) IE6 will re-send the request for each background image (not local) every time it is used. Even when there is a hover effect, the same background image is only in a different position, and IE6 will re-send the request. This frustrating thing needs to be solved: Copy code The code is as follows:html {filter:expression(document.execCommand("BackgroundImageCache", false, true));} Of course, the disadvantage is that it may slow down the loading speed of the entire page. Most people will choose the js method to implement: Copy code The code is as follows:<script type='text/javascript'> document.execCommand("BackgroundImageCache", false, true); </script> Disadvantages: Errors will occur if executed in browsers such as Firefox. So you need to determine whether it is an IE browser, using the judgment method provided by jQuery as follows: Copy code The code is as follows:<script type='text/javascript'> if ($.browser.msie) { document.execCommand("BackgroundImageCache", false, true); } </script> An even simpler approach is to use IE's conditional comments: Copy code The code is as follows:<!--[if lt IE 7]> <script>document.execCommand("BackgroundImageCache",false,true);</script> <![endif]--> |
<<: Use CSS blend modes and SVG to dynamically change the color of your product images
>>: How to use IDEA to create a web project and publish it to tomcat
1. Add alternative text to your logo This has two...
The operating environment of this tutorial: Windo...
WeChat applet uniapp realizes the left swipe to d...
This article example shares the specific code of ...
I installed it in msi format, mainly to see the m...
The method of wrapping the content (title attribut...
Table of contents What is a Binary Search Tree (B...
HTML page jump: window.open(url, "", &q...
Hexo binds a custom domain name to GitHub under W...
Table of contents 1. Basic Use 2. Working Princip...
How to obtain SQL statements with performance iss...
In order to download this database, it takes a lo...
This article example shares the specific code of ...
When using the idea development tool to debug cod...
Recommended Docker learning materials: https://ww...