Solved

How to link an entire table row to fancy box?

Posted on 2014-03-17
3
614 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 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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
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…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

688 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