Solved

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

Posted on 2003-10-22
4
1,203 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

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

Suggested Solutions

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
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…

837 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