|
#1
|
|||
|
|||
|
Displaying text over image in IE
Hi,
I'm trying to create an HTML page that displays an image and will display a small text at the location the mouse is clicked. I've gotten it to work with Firefox but am unable to get it to work with IE. After I determine the text I want to display (its in NamesList[]) at the clicked location I use the following Javascript code: Code:
var aDiv = document.createElement('div');
aDiv.setAttribute("id", LayerNm + divCnt++);
// Display the name at the upper left of rectangle given in NamesList[]
var absPt = relToAbs(NamesList[ix+dX], NamesList[ix+dY]); // get absolute point location
aDiv.setAttribute("style", 'position:absolute;left:' + absPt.x + 'px;top:'
+ absPt.y + 'px;font-weight:bold;color:cyan');
aDiv.appendChild(document.createTextNode(NamesList[ix+dName]));
aDiv.onmousedown = myMouseDown; // set for new div
imgDiv.parentNode.insertBefore(aDiv, imgDiv); // works!!!
Code:
imgDiv = document.getElementById('Image'); // set global one time here
...
<CENTER><IMG SRC="1990_Reunion-300_ED1.jpg" HEIGHT="96%" ALT="1990 Reunion" id="Image"></CENTER>
...
Is there code that will work in both browsers? Is there code that will work in IE that I can chose if in IE? Thanks, Norm |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Text with pop-up image | cujo1775 | Web | 6 | 09-04-2009 03:06 PM |
| text to image | b_bprimal | Java | 0 | 02-26-2007 04:58 AM |
| Script for scrolling | Mark | Web | 3 | 08-30-2001 12:45 PM |
| Double Text 1.0 | George Gilbert | vb.announcements | 0 | 08-19-2001 12:34 PM |
| Displaying the contents of a text file into a Text Area... | Gabriele | Java | 2 | 05-31-2000 11:11 AM |