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'); }); About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥. Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links. Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.