Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to link an entire table row to fancy box?

Posted on 2014-03-17
3
Medium Priority
?
650 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 34

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
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…
Suggested Courses

618 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