Home > Web Front-end > JS Tutorial > IE6 hack for js collection_javascript skills

IE6 hack for js collection_javascript skills

WBOY
Release: 2016-05-16 16:35:55
Original
1021 people have browsed it

1. The problem of iframe not displaying under IE6

Under IE6, you sometimes encounter the problem that the iframe does not display. It can be displayed after refreshing. This problem is not caused by slow page loading. There are many possible reasons for this problem:

The src attribute is placed at the front of the iframe (never seen before)
The height is set to 100%. The iframe under IE6 cannot get the actual height value. Solution: Set it to a fixed height value
This phenomenon will also occur when using the a tag to trigger the onclick event to dynamically create an iframe. The solution: add return false in the click function; such as:


2. The problem of multiple loading of css sprite under ie6

In CSS sprites under IE6 and CSS using background images, the same image will be loaded multiple times, increasing the number of requests. At the same time, flickering will occur in images with hover effects. Solution:

  <!--[if IE 6]> 
    <script type="text/javascript">
    document.execCommand("BackgroundImageCache",false,true);
  </script>
  <![endif]-->
Copy after login

3. Page jump fails

When using js's window.location.href=url to jump to the page under IE6, invalidity will occur, especially when onclick is used to execute the function in the a tag. Solution:

  window.location.href=url;return false;
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template