|
Click to publicize, if you like this article : |
During working on one of my project, i found that style.left does not work with Mozilla, chrome and safari but nicely works on internet explorer.
The code was :
var docStyle = document.getElementById("divAddPartnerAndProjectEntities").style;
docStyle.top = e.clientY;
docStyle.left = e.clientX-5;
docStyle .style.display = "";
And the simple solution is, append “px” at the end to work with other browsers.
and final code is:
var docStyle = document.getElementById("divAddPartnerAndProjectEntities").style;
docStyle.top = e.clientY+"px";
docStyle.left = e.clientX-5+"px";
docStyle .style.display = "";
Very Simple right ?
Possibly Related posts:
RSS Feed
Twitter
Posted in
Tags: