Posted By

reynish on 05/07/11


Tagged

jquery iefix


Versions (?)

Select box fix for IE


 / Published in: JavaScript
 

Might need some hacking to get it to work. It's mainly a reminder for me.

  1. $(function () {
  2. $(".ie6 .selectBoxIEFix select, .ie7 .selectBoxIEFix select, .ie8 .selectBoxIEFix select").each(function () {
  3. var elemWidth = $(this).width();
  4.  
  5. $(this).mouseover(function () {
  6. var parentHeight = $(this).parents('div').height();
  7. var elemPos = $(this).position();
  8.  
  9. $(this).parents('div').css({ 'height': parentHeight });
  10. $(this).stop(true, true).data("origWidth", $(this).css("width")).css({ "width": "auto", "position": "absolute", "top": elemPos.top, "left": elemPos.left });
  11. })
  12. $(this).mouseout(function () {
  13. $(this).delay(600).queue(function () {
  14. $(this).css({ "width": elemWidth, "position": "static" });
  15. });
  16. });
  17. })
  18. });

Report this snippet  

You need to login to post a comment.