Jump to content

troygappa

Circle Member
  • Posts

    5
  • Joined

  • Last visited

troygappa's Achievements

Level 2

Level 2 (2/20)

0

Reputation

  1. A guide would be great, thanks! If it changes anything, I'd like it to link to external websites rather than portfolio subpages.
  2. Hello @tuanphan, will this still work with 2 Portfolio Hover templates to change the background images?
  3. @tuanphan Hey thank you, I just removed it!
  4. Password: ForumTesting Hello, I’m currently using the Portfolio Hover page template strictly to change the background when hovering over a link, as this is the only way I’ve managed to achieve this effect so far. However, I'd like each link to redirect to an external page in a new tab, rather than redirecting to the standard internal portfolio pages in the same tab. I’ve managed to accomplish this with JavaScript using the code below, but it's extremely tedious and will get messed up when adding or changing the order of the list. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script> <script> //Project One document.querySelector("#sections > section > div.content-wrapper > div > div > div > div.portfolio-hover-items > ul > li:nth-child(1) > a").setAttribute('href', 'https://www.facebook.com/'); //Project Two document.querySelector("#sections > section > div.content-wrapper > div > div > div > div.portfolio-hover-items > ul > li:nth-child(2) > a").setAttribute('href', 'https://www.youtube.com/'); //Project Three document.querySelector("#sections > section > div.content-wrapper > div > div > div > div.portfolio-hover-items > ul > li:nth-child(3) > a").setAttribute('href', 'https://www.amazon.com/'); //Project Four document.querySelector("#sections > section > div.content-wrapper > div > div > div > div.portfolio-hover-items > ul > li:nth-child(4) > a").setAttribute('href', 'https://x.com/'); var all_links = document.querySelectorAll('a'); for (var i = 0; i < all_links.length; i++){ var a = all_links[i]; if(a.hostname != location.hostname) { a.rel = 'noopener'; a.target = '_blank'; } } </script> Is there a better way to do this? Thanks!
×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.