Jeremy Stein - Brain

« »

Allow csshover.htc to act on dynamic elements: rerun parseStylesheets

We used csshover.htc to allow IE5 & IE6 to provide rollover highlighting with the hover selector. Unfortunately, this didn’t support HTML that was generated dynamically, in our case by AJAX updates to the page. The solution was to add this line to csshover.htc:

window.parseStylesheets = parseStylesheets;

This made that method available to the rest of the code. Then, on AJAX update, I added this line:

if (window.parseStylesheets) window.parseStylesheets();

February 7, 2007 2 Comments.

2 Comments

  1. Toine Holtmann replied:

    TNX ALOT MAN!!! I was surfing the net for more than 2 days for this solution 😀 😀 😀

    You helped me big time

    March 30th, 2007 at 2:12 pm. Permalink.

  2. Matt Ford replied:

    Thank you so much – I realise you probably don’t look at these comments, but this has resolved the issue I was having. Oddly, the Csshover.htc was working fine in IE6 before we redesigned it, and afterwards it was just not working.

    Thanks again. I owe you a drink of your choice!

    October 5th, 2010 at 3:42 am. Permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

Why ask?

« »