help with html

  • Thread starter Thread starter Paul M
  • Start date Start date
P

Paul M

Hi I want to be able to use a table cell as a link as apposed to text so
when the mouse clicks in the td cell it will go to a URL
Any ideas on code to do this
Thanks
Paul M
 
A table cell doesn't have an "onclick" event, but a div does. Put a div into
the table cell, and add an "onclick" event handler for the div.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
 
Try this in the opening <td> tag for the cell.

<td onclick="javascript:window.open('http://www.google.com')" style="cursor:hand;">

Works for me. The style cursor:hand lets the user know it's a link.

There might be some browser compatibility issues though, I only tried it in IE

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
Also works with a title tag to display text:

<td onclick="javascript:window.open('http://www.google.com')" style="cursor:hand;" title="Click
anywhere to open the page">

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
Thanks Steve
Sorted
Paul M
Steve Easton said:
Try this in the opening <td> tag for the cell.

<td onclick="javascript:window.open('http://www.google.com')" style="cursor:hand;">

Works for me. The style cursor:hand lets the user know it's a link.

There might be some browser compatibility issues though, I only tried it in IE

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
.......................with a computer
 
Thanks
How can I get it to display the link in the same window as apposed opening
a new one
<td onclick="javascript:window.open('http://www.google.com')"
style="cursor:hand;">Google</td>

Thanks Paul M
Steve Easton said:
Also works with a title tag to display text:

<td onclick="javascript:window.open('http://www.google.com')"
style="cursor:hand;" title="Click
 
You can't with javascript:window.open.

Now I have to ask, if you're putting the word Google in the cell, why do you want to make the whole
cell "hot" with an onclick.
Why not just make Google the hyperlink, and then you can make the link open in the same window.


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
Hi
I am trying to have a navigation table where you hover over the table cell
and it highlights.I have achieved this with swap class but the curser
/pointer doesn't change to a hand symbol. the code you very kindly shared
with me works well but for the fact that it opens another window.
the affect I am trying to achieve is similar to here accept I don't need the
slide menu structure,just the cell highlight

http://www.projectseven.com/tutorials/navigation/swapclassmenu/smp01_ldeluxe.htm#

Best wishes
Paul M
 
Ah OK. You can do that very easily using CSS and swapping the colors using the hover attribute.

the left nav panel on this page does it that way.
http://www.95isalive.com/

The style sheet is here:
http://www.95isalive.com/95.css it's the .navpanel class

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
If you are linking to external sites, why would you want to replace your site with the other site
vs. loading the external site in a new window?

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top