Hyperlink text to appear when click on cell

M

Mary C.

I am trying to put some text into the html which I think would be faster than
having it in a doc as want it to appear on certain part on page. I am having
difficulty bringing up the word document as it comes up like a letter and
want to have it formatted. I guess I am in need of some document to tell me
how to do this. I have a html manual but not the best.

I know this may not be very clear.

Thanks.

Mary C. Lydon
 
A

Andrew Murray

Could you explain further what you want to do?

Are you trying to link to the Word document? You just need to create a
hyperlink the same as with any other file.

All you'd need to do, if I understand you correctly, is copy from the word
doc and paste to the section you want that text to appear in. (or just type
the text where you want it to appear).

Otherwise, post back with further details.
 
M

Mary C.

Thanks.

Here is what I want to do and hope it clears it up. I have on the home page
a table and on one of the cells in the table it is called FAQ. I want to
click on this and bring up the facts on the same page over toward the right
of the page. When I link it to the word document I get a page. I just want
the facts to appear on same page and when finished looking at it go back to
the home page to click on other links.

I hope this is clearer. I thank you. I know something is not clear to me.

Thanks.

Mary C. Lydon
 
T

Trevor L.

Hi Mary C.

I attach some code modifed from that by Murray, our esteemed guru on this
newsgroup.

It has a line of text "Click me", which when clicked puts some text on the
empty space. You can change this so that you use the cell contents instead
of "Click me".

You could even change it to onmouseover,
e.g.
<a href="javascript:;"
onmouseover="FP_setLayerText('layer1',
'This is the text displayed on mouseover')">

There could be a problem in removing the text though. I tried
<a href="javascript:;"
onmouseover="FP_setLayerText('layer1',
'This is the text displayed on mouseover')"
onmouseout="FP_setLayerText('layer1','')">
This works, but only once. Don't know why!!

Code follows
==================================================================================
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>On Click Demo</title>
<script language="JavaScript">
<!--
function FP_setLayerText(id,txt)
{//v1.0
var el = FP_getObjectByID(id)
if(el.innerHTML)
el.innerHTML = txt
}

function FP_getObjectByID(id,o)
{// v1.0
var c, el, els, f, m, n
if(!o) o = document

if(o.getElementById)
el = o.getElementById(id)
else if(o.layers)
c = o.layers
else if(o.all)
el = o.all[id]

if(el)
return el

if(o.id==id || o.name==id)
return o

if(o.childNodes)
c = o.childNodes
if(c)
for(n = 0; n < c.length; n++)
{ el = FP_getObjectByID(id,c[n])
if(el)
return el }

f = o.forms
if(f)
for(n = 0; n < f.length; n++)
{ els = f[n].elements
for(m = 0; m < els.length; m++)
{ el = FP_getObjectByID(id,els[n])
if(el)
return el }
}
return null
}
// -->
</script>
</head>

<body>
<div id="layer1"
style="position: absolute; width: 400px; height: 400px;
z-index: 1; left: 200px; top: 30px;
font-family: trebuchet,verdana,arial,sans-serif;
font-size: 14px; font-color: black; background: #FFC;
border: 8px green inset; padding: 15px;">
Watch this space
</div>

<p>
<a href="javascript:;"
onclick="FP_setLayerText('layer1',
'This is the text displayed on click')">
Click me
</a>
</p>

</body>
</html>
==================================================================================
 
T

Trevor L.

Mary C.

A refinement
Between </div> and </body>
<table>
<tr><td>
<a href="javascript:;"
onmouseover="FP_setLayerText('layer1',
'Item 1 text')"
onmouseout="FP_setLayerText('layer1','watch this space')">
Item 1
</a>
</td></tr>
<tr><td>
<a href="javascript:;"
onmouseover="FP_setLayerText('layer1',
'Item 2 text')"
onmouseout="FP_setLayerText('layer1','watch this space')">
Item 2
</a>
</td></tr>
</table>

This resets the text to 'watch this space' when you mouseout, but puts
different text according to which item you mouseover
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au
Hi Mary C.

I attach some code modifed from that by Murray, our esteemed guru on
this newsgroup.

It has a line of text "Click me", which when clicked puts some text
on the empty space. You can change this so that you use the cell
contents instead of "Click me".

You could even change it to onmouseover,
e.g.
<a href="javascript:;"
onmouseover="FP_setLayerText('layer1',
'This is the text displayed on mouseover')">

There could be a problem in removing the text though. I tried
<a href="javascript:;"
onmouseover="FP_setLayerText('layer1',
'This is the text displayed on mouseover')"
onmouseout="FP_setLayerText('layer1','')">
This works, but only once. Don't know why!!

Code follows
==================================================================================
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252"> <title>On Click Demo</title>
<script language="JavaScript">
<!--
function FP_setLayerText(id,txt)
{//v1.0
var el = FP_getObjectByID(id)
if(el.innerHTML)
el.innerHTML = txt
}

function FP_getObjectByID(id,o)
{// v1.0
var c, el, els, f, m, n
if(!o) o = document

if(o.getElementById)
el = o.getElementById(id)
else if(o.layers)
c = o.layers
else if(o.all)
el = o.all[id]

if(el)
return el

if(o.id==id || o.name==id)
return o

if(o.childNodes)
c = o.childNodes
if(c)
for(n = 0; n < c.length; n++)
{ el = FP_getObjectByID(id,c[n])
if(el)
return el }

f = o.forms
if(f)
for(n = 0; n < f.length; n++)
{ els = f[n].elements
for(m = 0; m < els.length; m++)
{ el = FP_getObjectByID(id,els[n])
if(el)
return el }
}
return null
}
// -->
</script>
</head>

<body>
<div id="layer1"
style="position: absolute; width: 400px; height: 400px;
z-index: 1; left: 200px; top: 30px;
font-family: trebuchet,verdana,arial,sans-serif;
font-size: 14px; font-color: black; background: #FFC;
border: 8px green inset; padding: 15px;">
Watch this space
</div>

<p>
<a href="javascript:;"
onclick="FP_setLayerText('layer1',
'This is the text displayed on click')">
Click me
</a>
</p>

</body>
</html>
==================================================================================
--
Cheers,
Trevor L.
Website: http://tandcl.homemail.com.au
Thanks.

Here is what I want to do and hope it clears it up. I have on the
home page a table and on one of the cells in the table it is called
FAQ. I want to click on this and bring up the facts on the same page
over toward the right of the page. When I link it to the word
document I get a page. I just want the facts to appear on same page
and when finished looking at it go back to the home page to click on
other links.

I hope this is clearer. I thank you. I know something is not clear
to me.

Thanks.

Mary C. Lydon
 
Top