Solved

Mouseover entire table cell, elliciting href cursor (presumably by CSS)

Posted on 2003-10-22
4
1,194 Views
Last Modified: 2012-05-04
Hello,

I'd like to creat the effect whereby the entire table cell is an active HREF region, such that the cursor changes into a pointer. Also, the cell comprises some text that also has to be an active HREF link (the same as the table cell it resides in).

Can this be done? If so, please inform me how.

Thank you.

NBB

0
Comment
Question by:normbry
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
DelTreme earned 200 total points
ID: 9597533
Yes.

<style>
.linkcell
{
cursor : "hand";
}
</style>

(...)

<td class="linkcell" onclick="JavaScript:window.location.assign('mypage.html');">Click here to go to mypage</td>
0
 
LVL 2

Expert Comment

by:weareu
ID: 9597539
Not sure what you wanna do...

Turning a cell into an active href region? Does this mean it must also go to a specific url when you click anywhere in the cell or that you just want the cursor to change?

How does the cell compromise text that has an href link?
Do you have an Anchor (<A>) tag around your table?

Please post a snippet of the code you are trying to use, this would probalby clear these questions up.
0
 
LVL 3

Expert Comment

by:DelTreme
ID: 9597555
Maybe some explanation would be usefull as well :)

The <style> part creates a custom class called "linkcell". Any object that has this class, will have a hand cursor instead of an arrow or I-beam.

Thus <td class="linkcell"> creates a cell, and if your mouse is in the cell region, the cursor changes into a hand.

For instance, add the <style> part into a html file, and try <b class="linkcell">bold text</b>, then put your mouse over it. The cursor will change into the hand cursor.

The onclick event is fired everytime the cell or one of its 'children' (the text in the cell) is clicked. So clicking anywhere in the cell will run the code:

JavaScript:window.location.assign('mypage.html');

Which loads the page, it's just like a normal link.
0
 

Author Comment

by:normbry
ID: 9597557
No muss, no fuss. Thanks DelTreme.

NB
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

786 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