juliaprather Posted January 18, 2022 Posted January 18, 2022 Site URL: https://www.lisawolffmcintyre.com/ Hi Squarespacers! I enabled the button element in my header and named it "Contact." When someone is viewing mobile, I'd like them to be able to tap the button to call my client. But when someone clicks the button from desktop—well, the attached image expresses my feelings about this situation. Is there code I can deploy that would allow a user to call from mobile but email from desktop? Thanks so much! Julia
tuanphan Posted January 19, 2022 Posted January 19, 2022 Add this code to Settings > Advanced > Code Injection > Footer <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script> $(document).ready(function() { $('.header-display-desktop a.btn').attr('href','mailto:lisa@palermolistings.com'); }); </script> juliaprather 1 Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
juliaprather Posted January 19, 2022 Author Posted January 19, 2022 Wow @tuanphan -- brilliant! I would never, ever, ever have sorted that myself. Your code is genius and works like a heaven. THANK YOU. tuanphan 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment