Additional code on Desktop layout only?
-
Hello there,
I'm adding some additional Javascript to a page on my site, using the dropdown in the editor:

The code runs something that is only really worthwhile on desktop, and works fine, but I don't want it to run on mobile. So, I created the custom mobile layout, clicking on the phone icon and choosing "start with empty layout" and created a new design, but the code still runs there on mobile.
Is there a way to add code this way and have it only work on the desktop version of the same page?
Thanks!!
-
Dear @R-Seance
It could be that you are loading the page in Desktop view and therefore the JS into the browser and reducing the browser size to mobile layout but then the JS is still present?, unsure sorry.
Would you be able to post your custom HTML/JS and then i can have a better idea and run some tests for you!!! :)
Interesting question and worth investigating @R-Seance
Talk soon & best wishes
Richard -
-
-
-
Dear @R-Seance
Of course 🌝sorry that chats isnt working for you!
Talk soon & have a wonderful day
Richard
-
Dear @R-Seance
Of course 🌝sorry that chats isnt working for you!
Talk soon & have a wonderful day
Richard
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login