Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Disabling Custom CSS on Mobile


NWCPhotos

Question

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 post
  • Answers 9
  • Created
  • Last Reply

Top Posters For This Question

9 answers to this question

Recommended Posts

  • 0
<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 BaNgan from 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 lightboxGeolocation Automatic Currency Converter, Sortable Table from GSheet
If 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 post
  • 0
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 post
  • 0

Show me your current site

Greeting, it's BaNgan from 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 lightboxGeolocation Automatic Currency Converter, Sortable Table from GSheet
If 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 post
  • 0
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 BaNgan from 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 lightboxGeolocation Automatic Currency Converter, Sortable Table from GSheet
If 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 post
  • 0

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. 

 

Link to post
  • 0
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 post
  • 0
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?

Link to post
  • 0
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 post

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...