m_hutchins Posted November 21, 2018 Share Posted November 21, 2018 Hello there, I should probably disclose that I'm not very savy in JS. I have a site that has a page loader on every page. I just want it on the homepage, but when I remove the page loader from a page, that page won't "load." I think see what's going on with the JS, it's saying when the page is loaded, load .page. But I'm not sure how to code this to just be on the homepage. The code I'm seeing for the the page loader is: // Initialize scripts that require a loaded page $window.on('load', function () { // Page loader & Page transition if (plugins.preloader.length && !isNoviBuilder) { pageTransition({ page: $('.page'), animDelay: 500, animDuration: 500, animIn: 'fadeIn', animOut: 'fadeOut', conditions: function (event, link) { return !/(\#|callto:|tel:|mailto:|:\/\/)/.test(link) && !event.currentTarget.hasAttribute('data-lightgallery'); }, onReady: function () { clearTimeout(loaderTimeoutId); plugins.preloader.addClass('loaded'); windowReady = true; } }); } }); The site is here: https://www.procommak.oiw11.com Any and all thoughts would be greatly appreciated! Thanks in advance, mh Link to comment Share on other sites More sharing options...
m_hutchins Posted November 26, 2018 Author Share Posted November 26, 2018 I also tried to change the class or take it away no luck. Any thoughts would be appreciated, for I am a noobie to JS. Thanks! Link to comment Share on other sites More sharing options...
justsomeguy Posted November 26, 2018 Share Posted November 26, 2018 I'm not clear on why you're using the loader or what you're doing to remove it. Link to comment Share on other sites More sharing options...
m_hutchins Posted November 27, 2018 Author Share Posted November 27, 2018 I'm trying to remove it. I've tried to just remove the the loader code from the pages, but they pages won't fully load/breaks the pages. I don't feel that it's necessary to have the loader on every page. I don't mind it on the homepage, but after that it's kind of redundant. I just can't figure out how to edit the JS so that it will still load the "page" without the loader. Link to comment Share on other sites More sharing options...
justsomeguy Posted November 27, 2018 Share Posted November 27, 2018 It looks like all it does is wait for the page to finish loading, and then it adds a class to the preloader div. If you remove the preloader div then you should see the page loading normally. It's just an overlay to hide the rest of the page while everything is downloading and rendering. Link to comment Share on other sites More sharing options...
m_hutchins Posted November 28, 2018 Author Share Posted November 28, 2018 It's a little strange, I can get the page to load if I take the loader div out and then take the "page" class out of the wrapping div that follows. But, I'm afraid that there is some code that is inside/using the "page" class and might break. If I'm understanding the loader JS correctly, its saying once the page is loaded, load "page." So when I just take the loader code out the page breaks and I just get a white screen. Is there a way to alter the JS to just run the loader? I hope that makes sense. Thanks again for taking the time to look at this! Link to comment Share on other sites More sharing options...
justsomeguy Posted November 28, 2018 Share Posted November 28, 2018 That code doesn't really do anything other than wait for the page to load, or specifically wait for window load event, and then it runs that pageTransition function, whatever that does. I'm assuming that all that happens is that it waits for the load event and then adds and removes some CSS classes. If you're worried about those classes used for other things you just need to search through all of the Javascript code to see what else is using it. Link to comment Share on other sites More sharing options...
m_hutchins Posted November 29, 2018 Author Share Posted November 29, 2018 On it! Thanks for the help again!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now