swoopnebula Posted August 5, 2021 Share Posted August 5, 2021 Site URL: http://www.thevisualpharmacy.com Hey All, I have a custom button that I have created for my products page that links off to an external site for people to purchase from. I have hidden the original purchase button and I am styling the new link using CSS to target the link. I am now trying to add a class to the URL Link using JQuery but I can't seem to get it right. I stumbled upon this code snippet here but upon using inspect element It doesn't show that the class has been added. $(function(){ var cUrl = window.location.href; $("a").each(function(){ if ($(this).attr("thevisualpharmacy.gumroad.com/l/nintendo64mockup") == cUrl){ $(this).addClass(“gumroad-button”-); } }); }); I have loaded the JQuery Library, I am not an expert at JQuery by any means. Any insight to this is helpful. Thank you guys. Link to comment
tuanphan Posted August 8, 2021 Share Posted August 8, 2021 this has an invalid symbol, try this ("gumroad-button") 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment