Jump to content

Archived

This topic is now archived and is closed to further replies.

ketri

How to disable unused footer scripts like parallax, fitvids, waypoints etc. for best performance?

Recommended Posts

ketri    7
ketri

In the footer of my site there is:
 

<!-- Footer Scripts -->
<script type='text/javascript' src='http://malmgord.dev/wp-content/themes/dms/js/script.bootstrap.min.js?ver=2.2.2'></script>
<script type='text/javascript' src='http://malmgord.dev/wp-content/themes/dms/js/script.resize.js?ver=1.1.6'></script>
<script type='text/javascript' src='http://malmgord.dev/wp-content/themes/dms/js/script.viewport.js?ver=1.1.6'></script>
<script type='text/javascript' src='http://malmgord.dev/wp-content/themes/dms/js/script.waypoints.js?ver=1.1.6'></script>
<script type='text/javascript' src='http://malmgord.dev/wp-content/themes/dms/js/script.easing.js?ver=1.1.6'></script>
<script type='text/javascript' src='http://malmgord.dev/wp-content/themes/dms/js/script.fitvids.js?ver=1.1.6'></script>
<script type='text/javascript' src='http://malmgord.dev/wp-content/themes/dms/js/parallax.js?ver=1.1.6'></script>
<script type='text/javascript' src='http://malmgord.dev/wp-content/themes/dms/js/pl.common.js?ver=1.1.6'></script>
<script type='text/javascript' src='http://malmgord.dev/wp-content/themes/dms-child/sections/navbar/navbar.js?ver=1.1.6'></script>

Two questions:
1. Why is DMS loading i.e. parallax.js when I'm not using it? Are there plans to optimize it so that only scripts that are needed by sections currently on the page are loaded?
2. How can I disable the ones I'm not using? Probably somehow in my child-themes functions.php?

 

 

Thanks! :)

Share this post


Link to post
Share on other sites
James B    436
James B

Hi there,

 

As far as I'm aware these scripts can be used inside certain sections or section areas so they'll load in the footer area after the main page content has loaded. Scripts will only be loaded if they're essential or required on the page, when developing the core team work on the basis that the theme only loads what's required. They'll be improvements in future editions as the theme moves forward.

 

You can disable any scripts using the hook provided in this link http://forum.pagelines.com/topic/30739-can-fitvidsjs-be-disabled-from-the-theme/


Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
ketri    7
ketri

Scripts will only be loaded if they're essential or required on the page, when developing the core team work on the basis that the theme only loads what's required.

So does this mean that loading unnecessary scripts is a bug and it's being worked on at some point?

That's good. Thanks. And until then I can use function you linked.

Share this post


Link to post
Share on other sites

  • Similar Content

    • flourishdesignstudio
      By flourishdesignstudio
      Hi,
      I am having an issue with the Lax sections on Platform 5. I can embed a widget or text box into a Lax section which is really neat, but the image in the background (the parallax image) seems to get stretched and doesn't scale in an attractive way.  For example, the page http://ed6.61e.myftpupload.com/#clients has a parallax section with a woman's face  and I thought is would scale as the browser window gets smaller but the zoom-level never changes. Also, the amount of parallax shift seems more dramatic than what we want. I thought that if I uploaded a shorter image it would scan/scroll less since the height from the image's top to bottom would be less. However, that doesn't seem to have any effect and I am at a loss of how to properly control the way the image is displayed within that box. Any thoughts, tips, or suggestions to get me pointed in the right direction?
      Thanks so much for the help!
    • globalnative
      By globalnative+
      Hi there! 
      I'm wondering if I can and how I can easily make a one page scrolling parallax site with menus which scroll rather than take me to a new page?
      Something like this: http://demo.vellumwp.com/home-pages/one-page-resort/.
      Thank you kindly
      Nate
      PS: my site: http://natemaingard.com
    • Houston Haynes
      By Houston Haynes+
      OK - folks - back with another nit... The "back to top" link works - BUT - it's only active (i.e. clickable with the associated action following) when the mouse-over hovers over the footer area of the page. I did a quick change of the z-depth (to -1) and nothing made a difference. Any thoughts on how to make the *entire* back-to-top icon hover-able/actionable? Thanks!
       

    • romanondrasek
      By romanondrasek
      hi all, I have some trouble using PL5 on my site. 
      I used plugins for event calendar (event on) and plugin (timetable responsive scheduler for WP) for schedule (classes) in the gym.
      The problem is, that post from this 2 plugins are shown without menu in header and footer. (I setup header and footer) in the page editor for all type of page. 
      When I create a lesson, it creates posts with slug (I have a slug "lekce" & event for events).
      I try to edit the post with PL editor, but editor is not opening on the post.

      Do you have some idea where should be some problem? Thanx so much.
      here are links for the sites :
      site with schedule :
      http://www.myfit.cz/rozvrh/
      site of one of the class (pilates)
      http://www.myfit.cz/lekce/pilates/
      site with calendar :
      http://www.myfit.cz/kalendar/
      7 side with one event from the calendar :
      http://www.myfit.cz/event/pilates-instruktor-akreditovana-licence/?ri=1
      when I have my site on DMS2 it was working :-(
       
       
    • j powers
      By j powers+
      Looking to fond the best way to add in some javascript, the script is from Salesforce to add a chat button, ie Chat available / chat offline.  I need to add this to a specific page though.
       
      Much apprciated 
       
×