|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
I have a problem whereby my page is dynamically being generated. I don't know where the images will appear on the screen. But I want to be able to show the div over the image when they click on the image, is this possible?
Any help would be much appreciated. Cheers. |
|
#2
|
||||
|
||||
|
Do the images have ids?
alert("Position from top of page: " + document.getElementById("img1").style.top + "\nPosition from left of page: " + document.getElementById("img1").style.left) note, there is no right or bottom you could perform a similar, thouigh slightly more random, method using document.getElementsByTagName("IMG").item(0).style.top These will return the specific position of the elements. |
|
#3
|
|||
|
|||
|
they do have Id's but when I add your piece of debugging, I don't get any results displayed. could this be due to the image not having a style set to it?
|
|
#4
|
||||
|
||||
|
How are you positioning your images then?
|
|
#5
|
|||
|
|||
|
Quote:
inside a table cell. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Setting div positions from dynamically created images |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|