?
Solved

How to link an entire table row to fancy box?

Posted on 2014-03-17
3
Medium Priority
?
632 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 33

Accepted Solution

by:
Big Monty earned 2000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

777 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