MrAdam Posted December 3, 2006 Share Posted December 3, 2006 Hi im trying to create a kind of pop up, much like the "My Assistant" menu on this forum. A can create the menu itself quite easily, just my problem is positioning it. I want to create it dead center horiztonally (not so bothered about vertically). I've tried using "screen.width", and then doing few sums to create a from left number, but it's not going well. Does anybody already have a script, or know the best way of doing it?-Thanks Link to comment Share on other sites More sharing options...
Webworldx Posted December 3, 2006 Share Posted December 3, 2006 Dead horizontal is screen.width minus half the size of your popup window. (or availWidth if you want to be picky) Link to comment Share on other sites More sharing options...
MrAdam Posted December 3, 2006 Author Share Posted December 3, 2006 it's not? .. if my pop up was say 400px wide, and my res like 1024, it would be 824px from the left, definately not the middle. i would have thought it would be: '(screen.width - popupWidth) / 2' ??but i can't seem to get that to work...:: UPDATE :: var promptWidth = 400;var fromLeft = ((screen.width - promptWidth) / 2) - 21; .. done it Link to comment Share on other sites More sharing options...
Webworldx Posted December 4, 2006 Share Posted December 4, 2006 I meant half screen width, sorry - was typing fast half avail width, half popup window Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now