Replies: 2 comments 8 replies
-
Looks like you're trying to animate a missing part of an svg. At least that's what I'm reading from the error and the line it links to in the minified code. The var t = Am("#purpose-lines")
, e = t.select("circle")
, n = t.selectAll("line")
, i = parseFloat(e.attr("cx"))
, r = parseFloat(e.attr("cy")); |
Beta Was this translation helpful? Give feedback.
3 replies
-
Just wanted to check if this is the best way to handle initialising functions:
Or would it be better to handle page-specific functions with something akin to:
|
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Bit of an odd one that I can't seem to crack:
It's one of those fun ones where it happens sometimes, not every time.
I've got all my JS funcrtions initialising within one init function, which is called on page load and then:
You can visit the dev site below, but steps to reproduce are:
Hover Methodology, click Purpose, then click to another menu link. Console lights up because it can't find an element, but the element it refers to is on the Purpose page, not one you're navigating too.
https://bb24.01110010.eu/team
The troublesome function (animations) itself checks the existence of the SVG it's animating, so I don't know why it would be triggering the console errors, when the new page you navigate to doesn't have the element on it.
I tried disabling the swup cache, and tried the content.replace hook but no dice.
i'm convinced it's either me misunderstanding the lifecycle change, or i've just written some verbose code... hence why I haven't created an issue/bug.
Any help would be greatly appreciated as I'm going slightly mad....
Beta Was this translation helpful? Give feedback.
All reactions