Guest Posted January 14, 2022 Share Posted January 14, 2022 (edited) Site URL: https://mustard-antelope-r3yf.squarespace.com/ pass is 123 Hi i can't seem to figure out how to add a intro loading screen to a website. we are wanting to add this gif as the loading icon. I just get a syntax error on the first line of the code when i add it to custom CSS. website is running squarespace 7.1this is the big we want to use instead of standard spinner <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script> $(window).load(function() { show(); }); function show() { $('.loader').delay(1000).hide(); $('body').fadeIn(); }; setTimeout(show, 3000); </script> <style> .loader { position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 9999; background: url('https://static1.squarespace.com/static/61d6d4735161ce457e0d2347/t/61e13e9917cc384fe1633c75/1642151578200/intro.gif') 50% 50% no-repeat rgb(249,249,249); } </style> Edited January 14, 2022 by ThomasHanley Link to comment
paul2009 Posted January 14, 2022 Share Posted January 14, 2022 2 hours ago, ThomasHanley said: I just get a syntax error on the first line of the code when i add it to custom CSS. The code you've shared isn't CSS so shouldn't be added to the Custom CSS panel. The code is HTML and contains some JavaScript and CSS within it. HTML should be added to Settings > Advanced > Code Injection. You'll need to be on a Business Plan or higher to use this (because Personal Plans don't support it). Also, your code uses an old version of jQuery (2.1.3) with known vulnerabilities. You'll be better using a newer version. Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional. Would you like your customers to be able to mark their favourite products in your Squarespace store? Link to comment
Guest Posted January 14, 2022 Share Posted January 14, 2022 (edited) 2 hours ago, paul2009 said: The code you've shared isn't CSS so shouldn't be added to the Custom CSS panel. The code is HTML and contains some JavaScript and CSS within it. HTML should be added to Settings > Advanced > Code Injection. You'll need to be on a Business Plan or higher to use this (because Personal Plans don't support it). Also, your code uses an old version of jQuery (2.1.3) with known vulnerabilities. You'll be better using a newer version. Hi i was able to find what im looking for however would it be possable to change it from the logo to a gif . since i dont want to have the gif as the logo.<!-- loading image --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script><div class="logoload"></div><script>$(function() { var loadLogo = $('header').find('img').attr('src'); $('.logoload').css('background-image', 'url(' + loadLogo + ')');});</script><style>.logoload { /* SET BACKGROUND COLOR */ background-color: #fff; /* SET BACKGROUND SIZE */ background-size: 200px; position: fixed; left: 0px; top: 0px; width: 100%; height: 100%; z-index: 9999; background-position: center; background-repeat: no-repeat;}</style><script type="text/javascript">$(window).load(function() { $(".logoload").delay(500).fadeOut("fast");})</script> Edited January 14, 2022 by ThomasHanley Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment