We are having the issue of the png fix downloading many times per page, thus causing page load time to take forever in IE.
We think the problem is due to the css rule being applied globally. We are using:
/* { behavior: url(/iepngfix.htc) } */
Is there an easy solution as opposed to targeting the rule to specific div's? Which would be a bit of work.
Thanks
2) Angus TurnbullGroup: Moderators Posts: 4042Joined: 7 Dec 2003Location: New ZealandIP: 203.109.--.--
Posted:
Applying to "*" is not the greatest deployment as it'll be rather slow as you have found. Remember you can use full normal CSS selectors, such as:
.png-alpha, #header img, .logo { behavior.... }
This is of course very dependent on your site, but in an external stylesheet maintenance should be pretty easy.
- Angus.
3) TarkenGroup: Members Posts: 2Joined: 7 Apr 2008Location: IP: 130.13.--.--
Posted:
Thank you, Angus!
I was beating my head over this issue for hours today before I happened upon this message.
Previously I had been using: document.styleSheets[0].addRule( '*', ... I changed this to only attaching to the specific items where I need the fix, and it improved page load times by as much as 30 seconds. Whereas I was sitting there previously, watching the "xxx items remaining" count down from about 300, now I don't even see that bit in the status bar anymore.
4) David O'LearyGroup: Guests IP: 70.237.--.--
Posted:
I just spent days trying to figure out why my site's pages were running much slower in IE7 than any other browser. Then last night, I noticed that for every page load (even simple pages), IE7 was consuming an additional 50megs of memory. I finally tracked the problem down to iepngfix.
We had been applying it globally, i.e. *. If I apply it just to img, it's still leaking memory, but only 5 megs instead of 50.
Is anyone else seeing this? Running the demo page I'm not seeing a memory leak so it must be something in my css file.
5) Angus TurnbullGroup: Moderators Posts: 4042Joined: 7 Dec 2003Location: New ZealandIP: 203.109.--.--
Posted:
If you have a lot of elements, adding a behavior to each of them will of course take up a lot of memory.
This script does absolutely nothing in IE7, though, which supports PNGs natively. In fact you could happily put it in an "IE6 only" stylesheet or use a hack like so:
* html #header { behavior: url(....) };
(where "* html" means "IE6 only rule"). Generally speaking: apply this script as narrowly as possible and only in IE5.5/6.