- Posts: 21
COMMUNITY FORUM
- Forum
- Free Joomla Extensions & Templates
- AllVideos
- AllVideos Javascript conflit with Headroom Gantry 5 Atom
AllVideos Javascript conflit with Headroom Gantry 5 Atom
- NIccolò Angeli
-
Topic Author
- Offline
- Junior Member
Allvideos: 4.8.0
Hello,
I have installed this Atom (www.inspiretheme.com/documentation/gantry5-particles/headroom-js) on a Gantry 5 Rockettheme Template (Galatea).
The "Headroom.js" atom fixes the site header and it loads the Headroom.js script to provide some animation options. For example, you can specify how the fixed element will get hidden - by sliding, swinging, flipping or bouncing.
The problem is that it conflicts with Allvideos plugin, when the plugin is enabled the Atom does not work, the site menu is not expandable anymore, and I get this error in console
Uncaught TypeError: $(...).headroom is not a function
at dispatch (jquery.js?dd4db3412883b9c1f67fd7f95fdc91d5:5226)
at elemData.handle (jquery.js?dd4db3412883b9c1f67fd7f95fdc91d5:4878)
Any chanche you can take a look at the headroom.js code and see if it possible to update Allvideo to avoid this conflict?
I attach the file below.
I cannot give you a link to test because I had to disable the atom on my live site, but in case I can give you private superuser access to a test site.
Thanks!
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- NIccolò Angeli
-
Topic Author
- Offline
- Junior Member
- Posts: 21
but any suggestion for non-coders on how to do this?
I tried to install and activate this plugin simplifyyourweb.com/documentation/jquery-easy/jquery-options
but it doesn't solve the issue
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Can you send me a link to your dev site?
No need to push it to public, I only need to see one page.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- NIccolò Angeli
-
Topic Author
- Offline
- Junior Member
- Posts: 21
The test site is offline so I need to send you a superuser access, can't post it here...
Thanks!
Please Log in or Create an account to join the conversation.
- NIccolò Angeli
-
Topic Author
- Offline
- Junior Member
- Posts: 21
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- NIccolò Angeli
-
Topic Author
- Offline
- Junior Member
- Posts: 21
Thank you!
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
AllVideos is not throwing any errors.
It could be related to how they build their anonymous functions, the script being loaded in the footer the load() trigger instead of the ready() etc etc..
Since it its an external library which I have no idea who and how it was built, the developer who built it needs to troubleshoot the issue.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- NIccolò Angeli
-
Topic Author
- Offline
- Junior Member
- Posts: 21
I contacted again Ivo from InspireTheme and here is his reply:
We've seen JS conflicts when AllVideos is being used many times before.
We've seen those conflicts with templates and extensions from many different providers and developers. We are not talking about our templates here.
In all that cases, AllVideos was causing the conflict.
We cannot tell for sure what in AllVideos is causing the issue. Is it the use of "MooTools" or is it something else...
Regarding our anonymous function that loads the script - we use a "self invoking anonymous function":
(function($) {
// Code goes here
})(jQuery);
Regarding the use of .load() instead of .ready() - we do it like that on purpose, on a very good purpose.
As you know, the code within .ready() is executed as soon as the document is ready (without the images).
While we need to wait until everything is fully loaded as we need to get a proper .height() of the element.
Moreover, what the guys at AllVideos are saying does not make much sense because .load() waits more compared to .ready(), it waits until everything's fully loaded.
Yes, we do know that .load() is removed from jQuery v3, but Joomla 3 ships with jQuery v1.12.x so this is out of the conversation.
And finally, what our "Headroom.js" atom does is to simply load the Headroom assets and provide the configuration values.
If the guys at AllVideos are interested, they might want to have a look at the Headroom.js repo on Github: github.com/WickyNilliams/headroom.js/
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
github.com/joomlaworks/allvideos/blob/master/plugin/jw_allvideos.php#L142-L146
You can see the path of the file is plugins/content/jw_allvideos/jw_allvideos.php
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- NIccolò Angeli
-
Topic Author
- Offline
- Junior Member
- Posts: 21
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
However I can still the library present.
I am sorry but since there are no JS errors and the extension in question was not developed by us, I cannot debug their code.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- NIccolò Angeli
-
Topic Author
- Offline
- Junior Member
- Posts: 21
Thank you
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
api.jquery.com/jquery.noconflict/
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Forum
- Free Joomla Extensions & Templates
- AllVideos
- AllVideos Javascript conflit with Headroom Gantry 5 Atom