4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Making a Cell a link
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Mon Feb 18, 2002 6:35 pm (22 years, 2 months ago) Reply with QuoteBack to Top

I know this sounds silly, but I currentley have a cell, with a logo in, and a tagline below, but as this is a mixture of text and images, is there a way I can make a click anywhere in a cell to take you to the home page.

Or if this is not possible, what code would I need if I wanted to take the underline off the text link?
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Mon Feb 18, 2002 6:59 pm (22 years, 2 months ago) Reply with QuoteBack to Top

Take a look at some phpBB boards. Some of them have a hack that lets you click anywhere in the cell where the name of the forum is to access it.

For example: http://www.support.34sp.com/phpBB/

Look at the code, it should give you a clue.

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Mon Feb 18, 2002 7:04 pm (22 years, 2 months ago) Reply with QuoteBack to Top

Still can't see how they do it Sad, also that is a really old version of PHPBB, it looks sooooooooooooo outdated!
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Darren
Team Member



Joined: 05 Feb 2002
Posts: 549
Location: London

PostPosted: Tue Feb 19, 2002 8:35 am (22 years, 2 months ago) Reply with QuoteBack to Top

Justin,

This is the bit of code they were using on that PHPBB. A combination of javascript and CSS. It doesn't work in Netscape 4.x on a Mac which probably means it won't work on the PC version either. IE should be fine though.

Darren

Quote:
<html>
<head>
<title>Test</title>

<style type="text/css">
<--
a { text-decoration: none}
a:link { text-decoration: none}
a:hover { text-decoration: underline}
-->
</style>

</head>
<body>


<table cellpadding="20">
<tr>
<TD height="30" BGCOLOR="#FF0000" onMouseOver="this.style.backgroundColor='#00FF00'; this.style.cursor='hand';" onMouseOut="this.style.backgroundColor='#FF0000';" onclick="window.location.href='linkhere.html'">Hello, <a href="linkhere.html">Click Here!</a> for more</td>
<tr>
</table>

</body>
</html>
OfflineView User's ProfileFind all posts by DarrenSend Personal MessageVisit Poster's Website
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Tue Feb 19, 2002 6:47 pm (22 years, 2 months ago) Reply with QuoteBack to Top

Quote:
It doesn't work in Netscape 4.x on a Mac which probably means it won't work on the PC version either. IE should be fine though.


It will probably validate (it's valid HTML), but it won't work in all browsers.

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Tue Feb 19, 2002 6:51 pm (22 years, 2 months ago) Reply with QuoteBack to Top

Then again, 97% of my visitors are IE, so if they use Netscape and Opera, they can go change!
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Garth Farley
WebHelper
WebHelper


Joined: 08 Jan 2002
Posts: 69
Location: Ireland

PostPosted: Wed Feb 20, 2002 10:27 am (22 years, 2 months ago) Reply with QuoteBack to Top

Yes Andrew, it should validate fine. You could nearly write an entire Javascript code on one line and stick it into the onMouseOver (or others) event handler.

Of course it's tidier to place the code into it's own function in a script tag, and call the function from the event handler.

But it should work fine. Browser permitting of course.

Garth Farley
OfflineView User's ProfileFind all posts by Garth FarleySend Personal Message
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Wed Feb 20, 2002 7:26 pm (22 years, 2 months ago) Reply with QuoteBack to Top

No need for it now, got a decent Web Graphics Package
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
willy
Junior WebHelper
Junior WebHelper


Joined: 24 Jan 2002
Posts: 6

PostPosted: Mon Mar 04, 2002 1:59 pm (22 years, 1 month ago) Reply with QuoteBack to Top

Even If you don't need it now....I've got it....duh....
Code:

<html>
<head>
<title>Test</title>

<style type="text/css">
<--
a {  text-decoration: none}
a:link {  text-decoration: none}
a:hover { text-decoration: underline}
-->
</style>

</head>
<body>


<table cellpadding="20">
  <tr>
<TD height="30" style="background:FF0000;cursor:text;" onMouseOver="background:#00FF00;cursorhand;" onMouseOut="bacground:#FF0000;"  onclick="javascript:window.location.href='linkhere.html'" >Hello, <a href="linkhere.html">Click Here!</a> for more</td>
  <tr>
</table>

</body>
</html>

________________________________
§willy§
Formerly willy on the users.f2s forums.
OfflineView User's ProfileFind all posts by willySend Personal MessageSend emailVisit Poster's WebsiteAOL Instant MessengerMSN Messenger
php4ever
Junior WebHelper
Junior WebHelper


Joined: 10 Oct 2002
Posts: 49

PostPosted: Thu May 02, 2002 3:46 am (21 years, 11 months ago) Reply with QuoteBack to Top

The answer to Justin's last question is to use some code to affect the style of links by using something like this either inline, between style-tags or in an external style sheet:
text-decoration:none;

With respect to his first question, here's the code which I've highlighted in blue, this being a modification of the code that Daniel refers to. Two points: 1) this will work on IE 4 and higher since it uses DHTML but it won't work on Netscape 4.07 -- I'm not sure if it works on any version of Netscape; 2) Note: that this works b/c of the onclick event-attribute of the <td> which is assigned javascript that can take the user to another URL or even, as in this case, execute a javascript URL.

<head>
<title>Untitled</title>
<style>
.pretty {background:#cccccc;}
.good {background:#ffcccc; cursor:hand;}
</style>
<script>
var mess = "Hi!";
</script>
</head>

<body>
<table>
<tr>
<TD class=pretty height="33"
onMouseOut="this.className='pretty'"
onMouseOver="this.className='good'"
onclick="window.location.href='javascript: alert(mess)'">Sample Text</td>
</tr>
</table>

</body>
OfflineView User's ProfileFind all posts by php4everSend Personal Message
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.359482 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme