Forum Moderators: open

Message Too Old, No Replies

Opening In Borderless New Window

Full version of clicked thumbnail pic to open in borderless new window

         

Scrimbler

3:02 am on Dec 9, 2004 (gmt 0)

10+ Year Member



Pretty much as the title says. I am currently using this code in the header for when i click on a thumbnail. The only trouble is that the new window it opens up has a border along the left and top which i do not want if possible...

<script type="text/javascript">
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=320,height=240,left = 200,top = 200');");
}
</script>

Is there a way to specify that the window opened will not have any borders?

Many thanks,

Scrimbler

whoisgregg

5:06 am on Dec 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This code works as expected for me... Grab the entire script or just add in the bolded parts.

<script type="text/javascript">
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=320,height=240,left = 200,top = 200');");
[b] eval("imgWin = page" + id +";");
imgWin.document.body.style.margin = '0'; [/b]
}
</script>

You could also simply improve the presentation of that image by changing the background color of the pop-up with the first bold line above being changed to:

 imgWin.document.body.style.backgroundColor = 'black'; 

Welcome to WebmasterWorld, Scrimbler!

Scrimbler

2:08 am on Dec 14, 2004 (gmt 0)

10+ Year Member



thanks.

i've tried your code out, but it's very tempremental (sp?). sometimes teh border is removed, then 3 seconds later it's back again.

-Scrimbler

Scrimbler

2:13 am on Dec 14, 2004 (gmt 0)

10+ Year Member



it also says in the status bar that there is an error on the page (once i've clicked a photo)

cheers,

Scrim

whoisgregg

7:18 pm on Dec 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A 3 second delay, huh? I don't know why it's doing that... perhaps someone else can provide a better solution. :(

jimbeetle

7:44 pm on Dec 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you're using IE with XP it might have something to do with SP2. Check these MS docs for info on window location, positioning, etc.

[msdn.microsoft.com...]

[msdn.microsoft.com...]