View unanswered posts | View active topics It is currently Mon Jan 20, 2020 8:18 am

Reply to topic  [ 2 posts ] 
 PIE and events 
Author Message

Joined: Tue Jul 20, 2010 7:25 am
Posts: 4
Post PIE and events

I've been using PIE a bit now and it seems to be fitting in quite well - there is one issue I have noticed however with events.

It seems that when I create an absolute positioned div element with a border-radius PIE puts in its own element above it in the DOM tree. When I do (for example) a mouse down event on it, I don't get the DIV as the srcElement on the event - it shows up in Dev Tools as a DispHTMLDivElement normally, but when I use PIE I get a DispHTMLGenericElement.

Is there a way we can make it not muck around with what is the expected event behaviour, or short of that have an attribute on the generic element which links to the real element?



Update - Investigation ensues:

I can look at the event.tagName and see that the PIE elements have funny ones:
"shape" which has a parent with tagName = "group1", which has a parent of tagName = "background", which has a parent of tagName = "css3-container", which is the top most PIE element. I can then get the nextSibling of this and I will have the correct element I want.



Update #2

There also seems to be an issue with putting events on PIE-ed divs - This could be in relation to my previous post which said that the behaviour wasn't going on right away so I had to readd the behaviour in a timeout - it seems that the eventhandler itself is not being triggered on mouseovers, because PIE's one is taking precedence.

What I have done is try to find the PIE element and attach it to that instead in a timeout:

normalDiv.attachEvent('on' + type, eventHandler);
setTimeout(function () {
   var prevEl = normalDiv.previousSibling;
   if (prevEl && (prevEl.tagName === "css3-container")) {
          prevEl.attachEvent('on' + type, eventHandler);
}, 1000);

Thu Jul 22, 2010 2:33 am

Joined: Wed Jul 14, 2010 11:46 am
Posts: 1452
Post Re: PIE and events
Thanks for the analysis. This sounds like where, due to the main element being given a transparent background, mouse events were not being honored on the empty area. If you are able to build the latest code and test that it fixes your issue as well that would be great.

Thu Jul 22, 2010 6:42 pm
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.