OK Here is the deal and the workaround ...

In IE, you need to have a backgroundColor in order to get a div to be clickable, but you can make it invisible
using the alpha opacity.

In Firefox, you don't need a bgcolor to make the div clickable.

The test case below works in both IE and Firefox ; you get the event when clicking on the invisible
div that is in front of the text.

Now the question is how to work this into the LzSprite code; for IE we need a sprite to have a default BGcolor and to
be opacity = 0 if we want it to behave like a SWF/Firefox region...




<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/DTD/strict.dtd ">
<html>
<body>

<script>
// a blue square
foo = document.createElement('div');
foo.style.position = 'absolute';
foo.style.width = "200px";
foo.style.height = "30px";
foo.style.backgroundColor = '#0000ff';
foo. () { alert('clicked on blue-background container')}
foo.style.top = "100px";
foo.style.left = "100px";
foo.style.visibility = "visible";
foo.style.display = "block";
document.body.appendChild(foo);


// some text
bar = document.createElement('div');
bar.style.position = 'absolute';
bar.style.backgroundColor = '#ffcccc';
//bar. () { alert('clicked on text')}
bar.style.visibility = "visible";
bar.style.display = "block";
bar.innerHTML = "Foobar 123456";
foo.appendChild (bar);



// a blue rectangle
barbox = document.createElement('div');

barbox.style.opacity = 0; // firefox
barbox.style.filter = "alpha(opacity=0)"; //IE6

barbox.style.backgroundColor = '#000000';
barbox.style.width = "200px";
barbox.style.height = "30px";
barbox. (e) { if (!e) {e = window.event}; alert('clicked on transparent div')}
barbox.style.position = 'absolute';
barbox.style.visibility = "visible";
barbox.style.display = "block";
foo.appendChild(barbox);

</script>

</body>
</html>


On 7/26/06, Henry Minsky <[EMAIL PROTECTED]> wrote:
Actually I don't think I have accurately described what is happening, I need to write some better DHTML test cases here..
test cases to follow...




On 7/26/06, Henry Minsky <[EMAIL PROTECTED]> wrote:

While working on bug http://www.openlaszlo.org/jira/browse/LPP-2357 , I have come to what seems like an impasse in different
behavior of mouse event propagation in Firefox (and swf) and Internet Explorer 6 (windows).

The issue is that in Firefox and SWF, if you have a view which is obscuring another view, and you click on it, as
long as the clicked view does not have a "onclick" handler, the click is passed to the view behind it, regardless of the
containment hierarchy. The runtime looks only at the geometric placement of the objects.

In IE however, events only "bubble" up the document element containment hierarchy. So a view which is geometrically behind another view, but is not in the the containing view chain, will never see that mouse clicks, regardless of whether the front view has a handler set or not.

I don't know an easy workaround for this at the event level. As far as application design, it seems like most apps could be designed to work around
this by not relying on events being passed through views which are in disjoint containment hierarchies, I guess.

Anyone know a way to make IE act like Firefox in this behavior??






--
Henry Minsky
Software Architect
[EMAIL PROTECTED]




--
Henry Minsky
Software Architect
[EMAIL PROTECTED]




--
Henry Minsky
Software Architect
[EMAIL PROTECTED]

_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev

Reply via email to