NWCPhotos Posted November 12, 2020 Share Posted November 12, 2020 Hello, First post here, looking for some advice working with the following css script: <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/scrollify/1.0.19/jquery.scrollify.min.js"></script> <script> $(function() { $.scrollify({ section : ".Index-page", }); }); </script> This "Scroll-Lock" script works great on my desktop site, but not so much on mobile. I think I'd rather just have it disabled on my mobile version. My thought would be to add a media query but I can't figure out where to put it in the above code. Thanks in advance. Link to comment
Beyondspace Posted November 12, 2020 Share Posted November 12, 2020 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/scrollify/1.0.19/jquery.scrollify.min.js"></script> <script> $(function() { $.scrollify({ section : ".Index-page", afterRender:function() { if (window.innerWidth <= 600) { $.scrollify.disable(); } else { $.scrollify.enable(); } }, afterResize:function() { if (window.innerWidth <= 600) { $.scrollify.disable(); } else { $.scrollify.enable(); } }, }); }); </script> Reference: jQuery Scrollify - Power steering for your scroll wheel (lukehaas.me) Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio pluginIf you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you Link to comment
NWCPhotos Posted November 12, 2020 Author Share Posted November 12, 2020 15 hours ago, bangank36 said: <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/scrollify/1.0.19/jquery.scrollify.min.js"></script> <script> $(function() { $.scrollify({ section : ".Index-page", afterRender:function() { if (window.innerWidth <= 600) { $.scrollify.disable(); } else { $.scrollify.enable(); } }, afterResize:function() { if (window.innerWidth <= 600) { $.scrollify.disable(); } else { $.scrollify.enable(); } }, }); }); </script> Reference: jQuery Scrollify - Power steering for your scroll wheel (lukehaas.me) Hey there, appreciate the response. I injected this into the header and it worked once but doesn't seem to work again. Seems close but might not be exact yet. Either way thank you, one step closer to sorting it out. Link to comment
Beyondspace Posted November 12, 2020 Share Posted November 12, 2020 Show me your current site Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio pluginIf you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you Link to comment
NWCPhotos Posted November 13, 2020 Author Share Posted November 13, 2020 https://www.nwcphotos.com/ PW: lock The code you sent above is currently injected in, the best pages to view for the effect would be the About page or the Portfolio page. Thanks for your help. Link to comment
Beyondspace Posted November 13, 2020 Share Posted November 13, 2020 2 minutes ago, NWCPhotos said: https://www.nwcphotos.com/ PW: lock The code you sent above is currently injected in, the best pages to view for the effect would be the About page or the Portfolio page. Thanks for your help. let me check Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio pluginIf you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you Link to comment
tuanphan Posted November 14, 2020 Share Posted November 14, 2020 If your site have ajax enabled, sometimes you need to disable ajax loading in Design > Site Styles > Ajax Loading On 11/13/2020 at 8:10 AM, NWCPhotos said: https://www.nwcphotos.com/ PW: lock The code you sent above is currently injected in, the best pages to view for the effect would be the About page or the Portfolio page. Thanks for your help. Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
NWCPhotos Posted November 14, 2020 Author Share Posted November 14, 2020 6 hours ago, tuanphan said: If your site have ajax enabled, sometimes you need to disable ajax loading in Design > Site Styles > Ajax Loading Just disabled that and tried the code out again. The original code works but the code suggested above to disable it on mobile doesn't for either desktop or mobile. Wish this feature was just built into squarespace lol Link to comment
tuanphan Posted November 20, 2020 Share Posted November 20, 2020 On 11/14/2020 at 10:32 PM, NWCPhotos said: Just disabled that and tried the code out again. The original code works but the code suggested above to disable it on mobile doesn't for either desktop or mobile. Wish this feature was just built into squarespace lol Hi. Do you still need help on this? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
NWCPhotos Posted November 24, 2020 Author Share Posted November 24, 2020 On 11/20/2020 at 4:48 AM, tuanphan said: Hi. Do you still need help on this? That would be great, at this point I am leaning more towards not doing to scroll snapping so it's not a deal breaker to have it or not, but if I could get it to work I would love to have it on my site. Link to comment
Wolfsilon Posted July 12, 2021 Share Posted July 12, 2021 This is incredibly late but I thought I'd add that Scrollify allows you to set the mobile initialization without having to customize the window size functions. Read the docs on Github or Scrollify! 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