Solved

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

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 …
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
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…

706 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

19 Experts available now in Live!

Get 1:1 Help Now