Skip to content

Commit

Permalink
Use user agent sniffing rather than document.all for MSIE detection
Browse files Browse the repository at this point in the history
New versions have document.all, and they should get the fixed image
positioning.
  • Loading branch information
Douglas Bagnall committed Aug 12, 2012
1 parent 3283c2c commit 024bf6f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/display.js
Expand Up @@ -206,7 +206,8 @@ _p4d_proto.start_moving_piece = function(position){
this.stop_moving_piece();
var img = this.elements.pieces[this.orientation ? 119 - position : position];
this.elements.moving_img = img;
img.style.position = (document.all) ? 'absolute': 'fixed';
var old_msie = /MSIE [56]/.test(navigator.userAgent);
img.style.position = (old_msie) ? 'absolute': 'fixed';
var yoffset = parseInt(P4WN_SQUARE_HEIGHT / 2);
if (window.event){
img.style.left = (window.event.clientX + 1) + "px";
Expand Down

0 comments on commit 024bf6f

Please sign in to comment.