Re: Mouse Wheel Events

132 views
Skip to first unread message

Matt Ellen

unread,
Mar 3, 2010, 9:12:53 AM3/3/10
to SVG Web
http://groups.google.com/group/svg-web/browse_thread/thread/02f38b36fd5948b3

I was trying to follow Bradley Neuberg's instructions to add the event
handler to the DIV containing the object, but I couldn't, as the DIV
is always underneath the object, so the DIV won't catch the mousewheel
event.

I then found a thread (http://www.ozzu.com/website-design-forum/
placing-div-over-flash-t25572.html) that explains how to get the DIV
above the object.

To make this work, I had to change the svg.js code a little.

Like so:

_determineCustomAttrs: function() {
var results = [];
if (this._embedType == 'object') {
var node = this._replaceMe;
var commonObj = document._createElement('object');
for (var j = 0; j < node.attributes.length; j++) {
var attr = node.attributes[j];
var attrName = attr.nodeName;
var attrValue = attr.nodeValue;

if (!attrValue && attrValue !== 'true') {
continue;
}

if (commonObj.getAttribute(attrName)) {
continue;
}

if (/^(id|name|width|height|data|class|style|codebase|type|
_listeners|addEventListener|onload)$/.test(attrName)) {
continue;
}

results.push({attrName: attrName.toString(),
attrValue: attrValue.toString()});
}
}

//added in this line
results.push({attrName: 'wmode', attrValue: 'transparent'});

return results;
},

Looking at the rest of the code, it seems that wmode should already be
transparent, but it wasn't. Once I'd made this change I was able to
capture the mousewheel event as described in Bradley's post.

Regards,
Matt.

Bradley Neuberg

unread,
Mar 15, 2010, 2:24:08 PM3/15/10
to svg...@googlegroups.com
Hi Matt, if you give your SVG root a color, such as <svg style="background-color: red'>, then the background _won't_ be transparent (i.e. the wmode won't be transparent). Simply leave a background _off_ the SVG root to have the Flash wmode be transparent.

--
You received this message because you are subscribed to the Google Groups "SVG Web" group.
To post to this group, send email to svg...@googlegroups.com.
To unsubscribe from this group, send email to svg-web+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/svg-web?hl=en.


Griffle the Waffle

unread,
Mar 18, 2010, 2:10:24 PM3/18/10
to svg...@googlegroups.com
Hi Bradley,

Oh. That makes sense then!

Thanks for clearing that up.

Regards,
Matt.


________________________________________________________________
Go Here: http://www.geocities.com/griffle_the_waffle/ppi/
For online and off line games

-----Original Message-----
From: "Bradley Neuberg" [bradn...@gmail.com]
Date: 15/03/2010 18:24
To: svg...@googlegroups.com
Subject: Re: Mouse Wheel Events

Note: Original message sent as attachment
   Hotel pics, info and virtual tours. Click here to book a hotel online.
Hotel
Click Here For More Information
 
Reply all
Reply to author
Forward
0 new messages