HTML and CSS Reference
In-Depth Information
The ondragover attribute doesn't work in IE8 and before.
There are two possible approaches to solving this problem. The first
approach is to handle the dragenter event, which older versions of IE
recognize, instead of the dragover event, which they do not.
If you don't need to support old
versions of IE , you don't need to
worry about the first approach,
although it's simple to fix:
In older versions of IE the
dragenter event has to be can-
celled instead of the dragover :
<ul id="drophere"
<ul id="drophere"
Also note that IE8 and earlier
need the dragOver event to
return false; .
The second (and better) approach is to attach the event handler in
script rather than declaratively in the HTML markup. The advantage
of this approach is that, while attaching the handler declaratively will
cause the event to fire, canceling that event won't make the element a
drop target in IE8 and earlier. But if you use the proprietary attach-
Event() method to attach to the dragOver event in script, canceling that
will make the element a drop target. Attaching the event this way is
straightforward; the code is shown here:
<!--[if lte IE 8]>
'ondragover', dragover
Search WWH ::

Custom Search