Top DevX Stories
Creating Custom Export Filters for StarOffice with XSLT
WPF Wonders: Using DataTemplates
Crystal Reports Family Offers Options for Developers
Avaya Aura Session Manager video
Avaya Aura Overview video
Search the forums:

Go Back   DevX.com Forums > DevX Developer Forums > Web

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 10-31-2009, 11:41 AM
Norm Norm is offline
Registered User
 
Join Date: Jul 2005
Location: SW MO, USA
Posts: 278
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!!!
Definitions from other parts of code:
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>
   ...
Works in Firefox, but not in IE.
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
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT -4. The time now is 10:30 AM.


Sponsored Links



Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.