Window Position - Post ID 2045
Hi all.
I'm back with another question.
I have maid a link to a html site that shows some photos.
This photo site have a fixed window size.
It's works perfect, BUT
Does anybody know how i can get this window to be in center position of the screen. No matter with Inch your monitor is???
I have setup up a test page (Again) to demo the "problem" if any want's to take a look on how i may do it.
The adress www.stegmann.cc
Thanks alot.
Bjarne
I'm back with another question.
I have maid a link to a html site that shows some photos.
This photo site have a fixed window size.
It's works perfect, BUT
Does anybody know how i can get this window to be in center position of the screen. No matter with Inch your monitor is???
I have setup up a test page (Again) to demo the "problem" if any want's to take a look on how i may do it.
The adress www.stegmann.cc
Thanks alot.
Bjarne
Bjarne,
Are you wanting horizontal centering? You have in your code some lines that look like this:
If you add a div around these two divs, you can style the surround div to have automatic left and right margins. Another option would be to center the entire page with automatic left and right margins.
Are you wanting horizontal centering? You have in your code some lines that look like this:
<h1>HD OB - BestBroadcastHire</h1>
<div id="framedivleft">
<iframe onload="autoResize('thumbframe');" src="pages/thumbnail/thumbnailpage1.html" align="right" width="100%" frameborder="0" id="thumbframe" name="leftframe" scrolling="auto"> </iframe>
</div>
<div id="framedivright">
<iframe onload="autoResize('imageframe');" src="pages/image/imagepage1.html" align="right" width="100%" frameborder="0" id="imageframe" name="fullframe" scrolling="auto"> </iframe>
</div>
<div id="framedivleft">
<iframe onload="autoResize('thumbframe');" src="pages/thumbnail/thumbnailpage1.html" align="right" width="100%" frameborder="0" id="thumbframe" name="leftframe" scrolling="auto"> </iframe>
</div>
<div id="framedivright">
<iframe onload="autoResize('imageframe');" src="pages/image/imagepage1.html" align="right" width="100%" frameborder="0" id="imageframe" name="fullframe" scrolling="auto"> </iframe>
</div>
If you add a div around these two divs, you can style the surround div to have automatic left and right margins. Another option would be to center the entire page with automatic left and right margins.
billr wrote:
Bjarne,
Are you wanting horizontal centering? You have in your code some lines that look like this:
If you add a div around these two divs, you can style the surround div to have automatic left and right margins. Another option would be to center the entire page with automatic left and right margins.
Bjarne,
Are you wanting horizontal centering? You have in your code some lines that look like this:
<h1>HD OB - BestBroadcastHire</h1>
<div id="framedivleft">
<iframe onload="autoResize('thumbframe');" src="pages/thumbnail/thumbnailpage1.html" align="right" width="100%" frameborder="0" id="thumbframe" name="leftframe" scrolling="auto"> </iframe>
</div>
<div id="framedivright">
<iframe onload="autoResize('imageframe');" src="pages/image/imagepage1.html" align="right" width="100%" frameborder="0" id="imageframe" name="fullframe" scrolling="auto"> </iframe>
</div>
<div id="framedivleft">
<iframe onload="autoResize('thumbframe');" src="pages/thumbnail/thumbnailpage1.html" align="right" width="100%" frameborder="0" id="thumbframe" name="leftframe" scrolling="auto"> </iframe>
</div>
<div id="framedivright">
<iframe onload="autoResize('imageframe');" src="pages/image/imagepage1.html" align="right" width="100%" frameborder="0" id="imageframe" name="fullframe" scrolling="auto"> </iframe>
</div>
If you add a div around these two divs, you can style the surround div to have automatic left and right margins. Another option would be to center the entire page with automatic left and right margins.
Hi Billr
I want to center the hole page to the screen.
My window have been set to a fixed size 800x790px
I want that "popup" window to be at the center horizontal and vertical on the screen.
How to do that?
Is it though a java script?
Some html code?
Regards Bjarne
Bjarne,
I suspect your javascript could be modified, but I do not have the javascript skills to do that. Your current code looks like this:
<img src="mouse_over.gif" alt="bbh ob" onclick="MM_openBrWindow('picture/bbh_ob/index.html','','status=yes,width=805,height=750')" />
That is the code that creates the window, specifies the window size, and loads the source. Some changes might set the location, but this is NOT a window on your current page, but is a separate browser window.
If you want it to be centered in your current page, you may want to use an iframe.
I suspect your javascript could be modified, but I do not have the javascript skills to do that. Your current code looks like this:
<img src="mouse_over.gif" alt="bbh ob" onclick="MM_openBrWindow('picture/bbh_ob/index.html','','status=yes,width=805,height=750')" />
That is the code that creates the window, specifies the window size, and loads the source. Some changes might set the location, but this is NOT a window on your current page, but is a separate browser window.
If you want it to be centered in your current page, you may want to use an iframe.
Hi Billr.
Yes i think your are right.
Some code in the line where i open and set the size of my browser window, could do the trick. But I don't know how to do it eighter.
It's not the content in the page i want to center. But the entire Browser window.
Can some one help here?
Please
Regards
Bjarne
Yes i think your are right.
Some code in the line where i open and set the size of my browser window, could do the trick. But I don't know how to do it eighter.
It's not the content in the page i want to center. But the entire Browser window.
Can some one help here?
Please
Regards
Bjarne
Here's a code you can use, or maybe see how it's coded. The first part goes in the head section..
I took the liberty to add your mouseover image to the code,
<Script Language=JavaScript Type='Text/JavaScript'>
function Pop(url_pop,name,etc) {
var lef = (window.screen.width-805)/2;
var to = (window.screen.height-750)/2;
window.open(url_pop,'Up','width=805,height=750,left='+lef+',top='+to);
}
</Script>
*****this next part in the body section...
<A href="#" onMouseOver="Pop('picture/bbh_ob/index.html')" title="Pop Window"><img src="mouse_over.gif" alt="bbh ob" ></a>
function Pop(url_pop,name,etc) {
var lef = (window.screen.width-805)/2;
var to = (window.screen.height-750)/2;
window.open(url_pop,'Up','width=805,height=750,left='+lef+',top='+to);
}
</Script>
*****this next part in the body section...
<A href="#" onMouseOver="Pop('picture/bbh_ob/index.html')" title="Pop Window"><img src="mouse_over.gif" alt="bbh ob" ></a>
I took the liberty to add your mouseover image to the code,
Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.