Jump to content

Custom Code

Recommended Posts

Site URL: https://demo104e25.squarespace.com/

Hi all,

I made a basic table with 1 column and 13 rows, each housing an image with a image-swap rollover. (It is the building drawing in the availability section) Does anyone know how I can make them click to open a link? (ie floor 7) I'm guessing I need to assign an a href or on-click function but I'm not having luck.

Ultimately I am trying to have it open a lightbox on click, however since I am using a paid plugin for lightboxes, I do not want to share that bit of code.

password:  colliers

<style>
table, th, td {
  border: 0px;
}
  
th, td, tr {
  padding-top: 0px;
  padding-bottom: 0px;
  margin: 0px;
}
</style>



<table style="width:auto" >
  

<tr><img src="https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b79e3ae8fa1a43339b3e/1610659743220/104E25_Stack_down-12.png" onmouseover="this.src='https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7f698976627956b4985/1610659831295/104E25_Stack_over-12.png'" onmouseout="this.src='https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b79e3ae8fa1a43339b3e/1610659743220/104E25_Stack_down-12.png'" /></tr>
  
<tr><img src="https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7a14e3b0270693d8330/1610659745496/104E25_Stack_down-11.png" onmouseover="this.src='https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7f598976627956b495e/1610659829015/104E25_Stack_over-11.png'" onmouseout="this.src='https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7a14e3b0270693d8330/1610659745496/104E25_Stack_down-11.png'" /></tr>
  
<tr><img src="https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7a337cd470d032d74e9/1610659747955/104E25_Stack_down-10.png" onmouseover="this.src='https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7f3552fa14b2cf9cabc/1610659827187/104E25_Stack_over-10.png'" onmouseout="this.src='https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7a337cd470d032d74e9/1610659747955/104E25_Stack_down-10.png'" /></tr>
  
<tr><img src="https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7a644f1817e558a2f07/1610659750254/104E25_Stack_down-9.png" onmouseover="this.src='https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7f03ae8fa1a4333a927/1610659824970/104E25_Stack_over-9.png'" onmouseout="this.src='https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7a644f1817e558a2f07/1610659750254/104E25_Stack_down-9.png'" /></tr>
  
<tr><img src="https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7aac27c91691746e5db/1610659754177/104E25_Stack_down-8.png" onmouseover="this.src='https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7ee05d42d08a1b5d372/1610659822724/104E25_Stack_over-8.png'" onmouseout="this.src='https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7aac27c91691746e5db/1610659754177/104E25_Stack_down-8.png'" /></tr>
  
<tr><img src="https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7ab1e32b02399679da2/1610659755742/104E25_Stack_down-7.png" onmouseover="this.src='https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7e6782fa205430d6cda/1610659814688/104E25_Stack_over-7.png'" onmouseout="this.src='https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7ab1e32b02399679da2/1610659755742/104E25_Stack_down-7.png'" /></tr>
  
<tr><img src="https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7ae44f1817e558a2f8f/1610659758860/104E25_Stack_down-6.png" onmouseover="this.src='https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7e4ed8dce1748ec1014/1610659812336/104E25_Stack_over-6.png'" onmouseout="this.src='https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7ae44f1817e558a2f8f/1610659758860/104E25_Stack_down-6.png'" /></tr>
  
<tr><img src="https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7b044f1817e558a2fb1/1610659760129/104E25_Stack_down-5.png" onmouseover="this.src='https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7e1c8d3e85c3f52aa2e/1610659809878/104E25_Stack_over-5.png'" onmouseout="this.src='https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7b044f1817e558a2fb1/1610659760129/104E25_Stack_down-5.png'" /></tr>
  
<tr><img src="https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7ca041e7937dbd69162/1610659786816/104E25_Stack_down-4.png" onmouseover="this.src='https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7df02b98a2acb72c7a5/1610659807600/104E25_Stack_over-4.png'" onmouseout="this.src='https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7ca041e7937dbd69162/1610659786816/104E25_Stack_down-4.png'" /></tr>
  
<tr><img src="https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7cdc1638e04af71ab62/1610659789250/104E25_Stack_down-3.png" onmouseover="this.src='https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7dd3964b53974f84def/1610659805460/104E25_Stack_over-3.png'" onmouseout="this.src='https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7cdc1638e04af71ab62/1610659789250/104E25_Stack_down-3.png'" /></tr>
  
<tr><img src="https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7cf37cd470d032d7f3e/1610659791370/104E25_Stack_down-2.png" onmouseover="this.src='https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7dac1638e04af71ac13/1610659802856/104E25_Stack_over-2.png'" onmouseout="this.src='https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7cf37cd470d032d7f3e/1610659791370/104E25_Stack_down-2.png'" /></tr>
  
<tr><img src="https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b79c8294765527bf5058/1610659740070/104E25_Stack_down-G.png" onmouseover="this.src='https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7f944f1817e558a3d48/1610659834469/104E25_Stack_over-G.png'" onmouseout="this.src='https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b79c8294765527bf5058/1610659740070/104E25_Stack_down-G.png'" /></tr>
  
    <tr><img src="https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b794573db65ca25b8328/1610659732591/104E25_Stack_down-LL.png" onmouseover="this.src='https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b7fbceaeb271af2785fe/1610659835968/104E25_Stack_over-LL.png'" onmouseout="this.src='https://static1.squarespace.com/static/5feb77c9aeb02e387937d1a6/t/6000b794573db65ca25b8328/1610659732591/104E25_Stack_down-LL.png'" /></tr>

</table>

 

Link to comment
  • Replies 2
  • Views 582
  • Created
  • Last Reply

The way you'd make an image linkable in HTML is to surround your element in anchor tags. So, to make an image link to somewhere on click,

<tr>
  <a href="https://www.google.com">
  	<img src="whatever">
  </a>
</tr>

When I look at your website though, I don't see this table or table rows, which makes me thing you have some plugin or additional code that is converting it to something else? Also, if you haven't viewed your site in mobile view, I recommend that you do so.

Link to comment
On 1/15/2021 at 12:40 AM, tazmeah said:

The way you'd make an image linkable in HTML is to surround your element in anchor tags. So, to make an image link to somewhere on click,


<tr>
  <a href="https://www.google.com">
  	<img src="whatever">
  </a>
</tr>

When I look at your website though, I don't see this table or table rows, which makes me thing you have some plugin or additional code that is converting it to something else? Also, if you haven't viewed your site in mobile view, I recommend that you do so.

Perfect. Thanks a bunch 🙂

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.