Closed rustyx closed 8 years ago
please use the mail list. this is not a bug. your selector has returned null
If this is not a bug, what is it, then? Mootools does not support SVG documents? Then this is a feature request. Please reopen.
@rustyx MooTools works with SVG. Please check this jsFiddle: https://jsfiddle.net/rmjwrt59/
If you still have problems, please make a jsFiddle and post in the mailing list, #irc
or Stackoverflow.
it does support svg. you are calling methods on invalid element objects. make sure your selector can return elements correctly before applying style changes
On Saturday, 26 December 2015, Rustam Abdullaev notifications@github.com wrote:
If this is not a bug, what is it, then? Mootools does not support SVG documents? Then this is a feature request. Please reopen.
— Reply to this email directly or view it on GitHub https://github.com/mootools/mootools-core/issues/2761#issuecomment-167353228 .
Dimitar Christoff
"JavaScript is to JAVA what hamster is to ham" @D_mitar - https://github.com/DimitarChristoff
jsfiddle is limited to HTML documents, I'm talking about native SVG, not SVG inlined in HTML. Here's an example in which I'm trying to capture some events with MooTools: http://rustyx.org/temp/moosvg.svg
You are using $$('a')
before the xml is loaded. Put that code in the end
of the page instead.
On Sat, Dec 26, 2015 at 9:47 PM, Rustam Abdullaev notifications@github.com wrote:
jsfiddle is limited to HTML documents, I'm talking about native SVG, not SVG inlined in HTML. Here's an example in which I'm trying to capture some events with MooTools: http://rustyx.org/temp/moosvg.svg
— Reply to this email directly or view it on GitHub https://github.com/mootools/mootools-core/issues/2761#issuecomment-167362003 .
Moving the code does not help. Also doesn't wrapping it in onload and on-DOMReady as in the examples below... http://rustyx.org/temp/moosvg.svg http://rustyx.org/temp/moosvg2.svg (onload - no luck) http://rustyx.org/temp/moosvg3.svg (DOMReady never fires)
And for completeness, defining SVG onload doesn't work either. http://rustyx.org/temp/moosvg4.svg (using <svg onload=...>)
I don't think we've ever tested/tried to use MooTools in SVG documents in this way.
The error comes from a feature detection test, that expects a HTML page. Apparently el = document.createElement('div');
creates a SVG kind of element that does not have the style
property like HTML kind elements have.
I'm sure we can fix most errors, but I'm not sure how much work it will to make everything work nicely.
Loading Mootools-core in an SVG document fails (in Chrome) with:
Line 4263 corresponds to:
After that I'm not able to use the
$
function or any other Mootools function in an SVG.I'm loading Mootools like this: