lieslmaduro Posted October 18, 2020 Share Posted October 18, 2020 Site URL: https://www.angeliquemartina.com/home Hi, I've created a custom social link (a search icon) to appear in a Squarespace 7.1 site header. But these social links are set to automatically open in a new tab. I would like the Search ico n (only this one) to open in the same tab. Hope there is someone out there with the solution! Link to comment
lieslmaduro Posted October 19, 2020 Author Share Posted October 19, 2020 So far, this is what I've come up with. But it targets all social links (not only the search icon link) <script> $(function(){ $('[target]').attr('target', '_self'); }); </script> Link to comment
paul2009 Posted October 19, 2020 Share Posted October 19, 2020 14 minutes ago, lieslmaduro said: It targets all social links (not only the search icon link) If you only want your code to apply to the /search link, you could simply change it to: $(function(){ $('a[href$="/search"]').attr('target', '_self'); }); Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional. Would you like your customers to be able to mark their favourite products in your Squarespace store? Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.