Kitz Forum

Internet => Web Hosting & Web Design => Topic started by: chenks on December 31, 2018, 01:11:11 PM

Title: jquery - moving from 1.10.2 to 3.3.1
Post by: chenks on December 31, 2018, 01:11:11 PM
anyone familiar with using jquery?

i had a page that used jquery min v1.10.2.
as the page could sometimes that a little while to fully load (pulling records from a database), i set a simple loader screen that sat on top until the page had loaded then disappeared to show the results below - worked very well.

Code: [Select]
$(window).load(function() {
// Animate loader off screen
$(".se-pre-con").fadeOut("slow");;
});

with this inside the content div

Code: [Select]
<div class="se-pre-con"></div>
i've moved the page over to using jquery min 3.3.1 and now the loader script doesn't work.
it hides the content as normal, but doesn't fadeout once it has completed. i can tell it has completed as the scroll bar appear and the loading icon on the browser stops.

so why does it not work with 3.3.1 but does work with 1.10.2 ?
Title: Re: jquery - moving from 1.10.2 to 3.3.1
Post by: chenks on December 31, 2018, 03:27:55 PM
it appears that

Code: [Select]
$(window).load(function() {has to change to
Code: [Select]
$(window).on("load",function() {