[Javascript] Could someone explain this to me.

Cutter Bl cutterbl at hotmail.com
Tue Jan 15 07:35:08 CST 2002


First, I think it's great that teachers are beginning to use the web as a 
viable teaching tool, not just through existing content but also in creating 
content. Wouldn't it be great to see learning topics all over the web 
accessible by everyone (kinda like the web was intended).

I think you would be better suited using Eric Bosrup's OverLib for your 
tooltips (http://www.bosrup.com/web/overlib/). Some very effective, 
efficient, and customizable code. Requires a little playing with, but I've 
never experienced an issue in any browser.

You can wrap an anchor <a> tag around an image tag.

<a href="javascript:void()" 
onClick="function('parameter1','parameter2')"><img src="images/pic1.gif" 
height="100" width="100" border="0" name="picMypicture"></a>

Hope this helps.

Cutter
http://www.falcon-knives.com

----Original Message Follows----
From: "Gary Histand" <ghistand at iwichita.com>

Javascripters:

I am an Organic Chemistry teacher trying to create an on-line tutorial for
my students. I have used Javascript in the past to do some minor things.
This is my first endeavor at a major undertaking and I am getting confused
early in the process. Perhaps some of you can help me.

I found the following code on-line. It allows for a box to pop-up when one
clicks a hyperlink. Below is the code, I understand it starts out
determining what browser is being used. Then the function showtip is where
the confusion comes in.

The first if statement: in plain english if NN6 or IE6 do the following.
It never says to show the div or to put text into the div or anything. What
is going on here?

The else if statement makes sense to me. If NN4 build the string and assign
to the box, put the box where in relation to where you clicked....

Then comes the function hidetip. It only says to hide for NN4. What happens
to NN6 and IE6?

Also this script only works for text that is in the <a></a> tag. It does not
work with an image as I have coded below. Why?

This is my first post so be gentle.

Thanks.

Gary Histand
Bethel College
North Newton, KS

<script >
<!--

if (!document.layers&&!document.all&&!document.getElementById)
event="test"
function showtip(current,e,text){

if (document.all||document.getElementById){
thetitle=text.split('<br>')
if (thetitle.length>1){
thetitles=''
for (i=0;i<thetitle.length;i++)
thetitles+=thetitle[i]
current.title=thetitles
}
else
current.title=text
}

else if (document.layers){
document.tooltip.document.write('<layer bgColor="white" style="border:1px
solid black;font-size:12px;">'+text+'</layer>')
document.tooltip.document.close()
document.tooltip.left=e.pageX+5
document.tooltip.top=e.pageY+5
document.tooltip.visibility="show"
}
}
function hidetip(){
if (document.layers)
document.tooltip.visibility="hidden"
}
//-->
</script>

<div id="tooltip" style="position:absolute;visibility:hidden"></div>

<a href="javascript:void(0)" onclick="showtip(this, event,'This is a
Williamson Ether Synthesis')" onMouseout="hidetip()">hint<img
src="hintbutton.gif" alt="" width="66" height="22" border="0"></a>




_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript


_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com




More information about the Javascript mailing list