Jump to content

Tyring to Turn off/Take Away Page Loader Breaks Pages/Site


m_hutchins

Recommended Posts

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

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

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...