Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is this code not functioning with IE 8?

Could anyone help me to figure out why this code does not work on IE 8 ? (It works on Chrome, Firefox, Opera).

The code use Raphäel.js library, the code allow user to mouse drag Raphäel.js elements (e.g. circle, rectanglar)

Please have a look here:

var paper = Raphael(0, 0, '100%', '100%');

var circle = paper.circle(75, 75, 50);
var rect = paper.rect(150, 150, 50, 50);

var set = paper.set();

set.push(circle, rect);
set.attr({
    fill: 'red',
    stroke: 0
});

var ox = 0;
var oy = 0;
var dragging = false;

set.mousedown(function(event) {
    ox = event.screenX;
    oy = event.screenY;
    set.attr({
        opacity: .5
    });
    dragging = true;
});

set.mousemove(function(event) {
    if (dragging) {
        set.translate(event.screenX - ox, event.screenY - oy);
        ox = event.screenX;
        oy = event.screenY;
    }
});

set.mouseup(function(event) {
    dragging = false;
    set.attr({
        opacity: 1
    });
});
like image 212
Mellon Avatar asked Sep 08 '11 12:09

Mellon


People also ask

Can I install IE8 on Windows 10?

No, you cannot install IE8 on Windows 10. If a website will only work with IE8, open Developer Tool from F12. On the Emulation tab, set User Agent to be IE8. You will have to do this every time you access this site.


1 Answers

there seems to be an error in the way ie8 and ie9 handle mouse move events http://css.dzone.com/news/internet-explorer-8-fix-event-

like image 69
Spider Avatar answered Oct 26 '22 21:10

Spider