Thursday, September 15, 2011

jQuery UI draggable quirk in IE9

This will cause problems with jQuery UI's draggable in IE9 as if a TH (with moveableColumn as a class) is "draggable" when one drags and mouses away the cursor will remain as the move cursor until one clicks:

<script language="javascript" type="text/javascript">

   $(function () {

      $('.moveableColumn').hover(function () {

         $(this).attr('style', "cursor: move;");

      },

         function () {

            $(this).attr('style', "cursor: default;");

         }

      );

   });

</script>

 
 

This is the fix:

<script type="text/javascript">

   $(function () {

      $('.moveableColumn').hover(function () {

         $(this).css('cursor', 'move');

      });

   });

</script>

No comments:

Post a Comment