Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Dante › "SWIFT is not defined" error after 2.82 -> 3.06 upgrade
New Landing › How can we help? › Themeforest Theme Support › Dante › "SWIFT is not defined" error after 2.82 -> 3.06 upgrade
- This topic has 10 replies, 4 voices, and was last updated 9 years by Rui Guerreiro – SUPPORT.
-
Posted in: Dante
-
August 15, 2015 at 6:59 pm #204324
The error occurs in functions.js line 2748:
`SWIFT.parallax.parallaxVideoResize(parallaxAsset);
I am seeing some erratic behavior now related to loading and resizing of videos…
This error is reported by Chrome, Firefox and IE(11).
August 15, 2015 at 7:08 pm #204328Hmmm, also, smoothscroll links no longer work, throwing an error:
Uncaught TypeError: Cannot read property ‘top’ of undefined
functions.js line 151
jQuery('html, body').stop().animate({ scrollTop: jQuery(linkHref).offset().top + spacerHeight - headerHeight - 10 }, 1000, 'easeInOutExpo');
August 15, 2015 at 8:03 pm #204331Hi @cormip
The first is fixed for the next update. For the second, check the element actually exists on the page?
– Ed
August 15, 2015 at 10:21 pm #204335It scrolls to the correct section of the page, only it does not do it smoothly. I no longer see where I can add an optional class (smooth-scroll-link) to menu items like in this picture.
What I see is attached below.
Attachments:
You must be logged in to view attached files.August 16, 2015 at 12:58 am #204337Go to the Screen Options tab at the top of the menu admin page – make sure CSS Classes is checked.
– Ed
August 16, 2015 at 1:10 am #204338OK, sorry, didn’t even know that was an option. I’ve gone ahead and added the smooth-scroll-link custom class to the menu items, however it appears that it applies the class to the li container and not the anchor tag itself:
<li class="menu-item-22 smooth-scroll-link menu-item menu-item-type-custom menu-item-object-custom"> <a href="//stormwaternc.com#about">About<span class="nav-line"></span></a> </li>
Looking at the code that triggers it in function.js, it appears that this class needs to be specifically applied to the anchor tag:
// SMOOTH SCROLL LINKS jQuery('a.smooth-scroll-link').on('click', function(e) {
Therefore, the smooth scroll still isn’t working…
August 16, 2015 at 1:52 am #204339Apologies – was confused about that. The menu links automatically with a # link, but can only do so with the # at the start.
– Ed
August 17, 2015 at 11:59 am #204531Have same issue with `SWIFT.parallax.parallaxVideoResize(parallaxAsset);.
Using Safari.Reverted back to 2.8.2 for now.
August 17, 2015 at 3:18 pm #204622Sending out update later on today.
– Ed
August 17, 2015 at 3:41 pm #204637OK, I updated the menu links to start with a # and it fixed the smooth-scroll issues. However, using such links introduces a new problem for which I did find a work-around which I’ll document for other who might run into the problem:
If the user clicks to view a team member page, that page does not contain the sections or anchors that the home page has. Therefore, if the menu link is simply “#contact”, this works on the home page to scroll to the contact form I placed at the bottom of the page. However, this menu now no longer works on the Team member pages, since that anchor doesn’t exist.
The Solution
Create 2 separate menus: one with just the anchors as links (e.g. #contact) and another with the full URL with anchor link (e.g. //mywebsite.com#contact). The second menu you set as the “default” for the site. The first you manually set for the given page using the Page Meta tab.
This combo makes the smooth-scroll work on the home page, and the team, portfolio, etc theme sub-pages will also have a working menu that navigates back to the proper section of the Home Page.
August 17, 2015 at 10:36 pm #204741Glad you sorted. Thanks for sharing your solution with others.
-Rui -
Posted in: Dante
You must be logged in and have valid license to reply to this topic.