Posted By

vagrantradio on 06/26/10


Tagged

css browser ie6 ie7 selector pseudo


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

crispunk
d55beck
o0110o


jQuery IE6 & IE7 Pseudo-Selector Workaround


 / Published in: jQuery
 

  1. //instead of this CSS:
  2. #box:after {stuff}
  3. #box:before {stuff}
  4.  
  5. //do this with jQuery
  6. $(document).ready(function() {
  7. if ($.browser.msie && $.browser.version <= 7) {
  8. $("#box").after("stuff after");
  9. $("#box").before("stuff before");
  10. }
  11. });
  12.  
  13. //or
  14.  
  15. $(document).ready(function() {
  16. if ($.browser.msie && $.browser.version <= 7) {
  17. $("#box").insertAfter("stuff after");
  18. $("#box").insertBefore("stuff before");
  19. }
  20. });

Report this snippet  

You need to login to post a comment.