Tagged: mobile, scroll to top
-
AuthorPosts
-
March 14, 2016 at 1:24 pm #597693
LOVE this theme!! I’m trying to find a way to show the “scroll to top” button on mobile only (hidden on desktop and tablet)? I’ve found some older threads, but they seemed to always show the scroll to top button, not just hide it in certain scenarios. Thanks!
March 14, 2016 at 10:18 pm #598008Hey 4thephil!
Thanks for getting in touch!
Please try adding the following code to the Quick CSS field under the General Styling tab in the theme options:
@media screen and (min-device-width: 1200px) and (max-device-width: 1600px){ a#scroll-top-link { display: none; } }
Best regards,
JordanMarch 15, 2016 at 2:33 am #598100Hi Jordan,
That didn’t seem to work – it produced the opposite effect: hidden on mobile, displaying on desktop. I also tried the below, but that didn’t work either, again showing the reverse of what it should be:
a#scroll-top-link { visibility: visible; } @media (max-width: 800px) { a#scroll-top-link { visibility: hidden !important; } }
March 15, 2016 at 4:38 am #598130Hi!
Please use the below code to view scroll to top only on mobile :)
/* Only Mobile */ @media only screen and (min-width: 769px) { a#scroll-top-link { display: none!important; } }
Regards,
Vinay KashyapMarch 15, 2016 at 5:07 am #598151Hey there!
Hm, that seemed to hide the “scroll to top” on all devices
Link to site with the above code in Private Content
March 15, 2016 at 6:04 am #598166Hey!
We need access to your site to check if there are any other code conflicting and set this up correctly for you please create a temporary user with ‘administrator’ role and share in private content with permission to deactivate all plugins and add custom code if necessary to help you resolve this issue.
Cheers!
Vinay KashyapMarch 15, 2016 at 6:16 am #598172Thank you so much for the help!!!
March 17, 2016 at 1:15 am #599313Hey!
The login credentials you’ve provided do not work please send us working login credentials with user role as ‘administrator’ to resolve the issue.
However the below code has been tested on our installation and it works perfect! It will enable the scroll to top link only on the mobile screens and disable on tablets and desktops.
Before adding this code please remove all related codes added earlier so there is no conflict.
@media only screen and (min-width: 769px) { #scroll-top-link { display: none !important; }} @media only screen and (max-width: 768px) { #scroll-top-link { display: block !important; }}
If you still have any issues please send us working login credentials :)
Best regards,
Vinay KashyapMarch 17, 2016 at 2:28 am #599341Thank you! That code worked :) Seems it needed the explicit “display: block !important;” if it needed to show, that must be the missing link there. Thank you!! (And sorry about the non-working admin account credentials, strange, but nonetheless this code worked).
LOVE THIS THEME!
March 17, 2016 at 2:57 am #599360Hey!
Glad we could help and thank you for the kind words :)
We really appreciate it if you rate our theme on themeforest!
Best regards,
Vinay Kashyap -
AuthorPosts
- You must be logged in to reply to this topic.