Solved

How to link an entire table row to fancy box?

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
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.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

747 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

12 Experts available now in Live!

Get 1:1 Help Now