PDA

View Full Version : Positioning Woes for Show Hint Script



Mng026
05-09-2008, 12:34 AM
1) Script Title: Show Hint Script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex16/showhint.htm

3) Describe problem: I can't for the life of me figure out why the horizontal and vertical offsets of the hint box from their anchor do nothing when I change them. Can someone please have a look at my page/script and see if something is conflicting with this variable? Roll over the plate of pasta for the Hint... I am trying to position the Tip to upper left of the image. The link to the page is:

http://www.stonehouseproductions.com/cheryl_test.html

Thanks in advance,
Mike

jscheuer1
05-09-2008, 03:12 AM
There are two major issues here. One is that another script linked later on to your page has a function with the same name as a function in the tip script, but that works a little differently. So, in the tip script, change all three instances of the word:

clearbrowseredge

to:

tipClearbrowseredge

The other is that usually the tip keys off of an anchor, but when that anchor is for an image, some browsers see the layout differently for the anchor. All browsers agree upon where the image is though. So move your onmouseover event to the image:


<a class="hintanchor"><img onmouseover="showhint('Please choose a username. Should consist of alphanumeric characters only.', this, event, '150px')" src="images/clear_pasta.gif" border="none"></a>

Once these two things are taken care of, positioning the tip in any browser will be much more intuitive. But, to get things within range of what you say you want to start, use the highlighted values as shown:


<script type="text/javascript">

/***********************************************
* Show Hint script- Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var horizontal_offset="-350px" //horizontal offset of hint box from anchor link

/////No further editting needed

var vertical_offset="0" //horizontal offset of hint box from anchor link. No need to change.
var ie=document.all
var ns6=document.getElement . . .

Mng026
05-09-2008, 01:00 PM
You really rock. Works great..makes a lot of sense too :) I'm learning so much, thanks for everything.

Mike