Solved

How to link an entire table row to fancy box?

Posted on 2014-03-17
3
581 Views
Last Modified: 2014-05-25
I am fairly new to web design and I recently asked a similar question on another post.  The most recent question got me a bit closer to my end goal.  I am now able to link an entire table row to an image.  However that takes me to another page.  What I would like to do is launch fancy box when the row is clicked.

The inserted code is what I am currently using to link the entire table row.

<tr class="url-2" onclick="window.location.href='images/products/sii-2fle.jpg'">

Open in new window

0
Comment
Question by:ExchangeMe
3 Comments
 
LVL 32

Accepted Solution

by:
Big Monty earned 500 total points
ID: 39934836
untested, but should work:

var itemRow = $('tr.url-2');

itemRow.click(function(e) {
    e.preventDefault();
    $.fancybox({
        'href': $(this).find('.foo').attr('href'),
        'width': '100%',
        'height': '100%',
        'autoScale': false,
        'transitionIn': 'none',
        'transitionOut': 'none',
        'type': 'iframe'
    });
});

Open in new window


and your html would look like:

<table>
    <tr class='url-2'>
         <td><a href='images/products/sii-2fle.jpg' class='foo'>foo</a><td>
     </tr>
     .......
</table>

Open in new window

0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
The viewer will learn how to count occurrences of each item in an array.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now