• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Absolute div dynamically appended to body element

 
ramnna jain
Ranch Hand
Posts: 129
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On my web page there are hundreds of images managed in several rows.
It means it requires to scroll & scroll to view all...

On mouse move I want to show the bigger image.
I dynamically create an another div to contain the bigger image.



Using this code I append the newly created div to the body element.
The style for this div has position:absolute.

I took the coordinate with respect to the browser window & with respect to the entire document and successfully achieved the desired target on mouse over in IE.
But I am not getting the same effect in mozilla. In mozilla the div goes down at the bottom.

I want any suggestions & help to resolve the issue.

thank you
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the magical code you are using to set the div's position?

Eric
 
ramnna jain
Ranch Hand
Posts: 129
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To see what is the problem while opening it with Mozill, I am providing the link to the page:
http://www.dichoo.com/ramnna/myhtml.html

Just look the side scrollbar in Mozilla when you mouse over the image.


The Code:


myhtml.html





myjs.js





mycss.css



 
ramnna jain
Ranch Hand
Posts: 129
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One more thing that I want to know to resolve the above problem is:

What would happen if I append new absolute positioned Div element to some static block element using appendChild
& then on mouse over change the absolute position. Would it behave differently on Mozilla & IE.

some buddy have any idea...

 
ramnna jain
Ranch Hand
Posts: 129
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eric, could you please provide me any suggestion or help ...

Finding cursor position with respect to the div can also help me to solve the problem...

 
ramnna jain
Ranch Hand
Posts: 129
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I searched a code to get mouse coordinate with respect to a given element.

It is returning the mouse coordinates when my mouse enters in it.
And the coordinates are calculated with respect to the top left border of the element.

It is working fine in IE but unfortunately not giving correct coordinates in Mozilla.
Here I am stating the Url & the code...

Please if any one have idea to get the correct coordinates in Mozilla..


http://www.astahost.com/info.php/Mouse-Position_t16403.html




 
ramnna jain
Ranch Hand
Posts: 129
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It was really a silly mistake...

I typed:



I needed to write:



Now the code working fine on bothe the browser...

thank you...
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic