PDA

View Full Version : Smaller window off main page


bolloscript
12-07-2005, 12:26 AM
Hi,
I created a new browser window from the behaviour panel in dw.

What I'm stuck on now, is that the new window goes straight to the top of the 'parent' page, which in turn scrolls immediately back to the top.

What I want is for the parent page to stay where it is, & the new small window to open next to the link.
The behaviour panel doesn't show me any options to do this.
Is there a function in dw to do this, or a tag I can use?

Thanks in advance :)

This is the code that dw wrote.

click here (#) to hear a sample [/b]

Taz69
12-07-2005, 09:29 AM
when you set the behaviour, you need to adjust the target window to _blank not _parent this will open a new window for the link

Taz

davidj
12-07-2005, 11:14 AM
are you talking about position?

do you want the window to popup at a location you choose

bolloscript
12-07-2005, 11:25 AM
are you talking about position?

do you want the window to popup at a location you choose
Yes, and ideally I'd like the 'parent' page not to automatically scroll to the top.
:)

davidj
12-07-2005, 11:42 AM
ok

function.. Inside script tags in <head></head>

//tmtC_winOpen
var newWin;
//tmtC_winOpenEnd

function tmt_winOpen(u,id,f,df){
if(eval(id)==null||eval(id+".closed")){
eval(id+"=window.open('"+u+"','"+id+"','"+f+"')"); eval(id+".focus()");}
else if(df){eval(id+".focus()");}
else{eval(id+"=window.open('"+u+"','"+id+"','"+f+" ')");eval(id+".focus()");}
}

link should look like this

<a href="javascript:tmt_winOpen(yourpage.html','newWi n','width=400,height=400,left=300,top=200,
toolbar=yes,menubar=yes,location=yes,scrollbars=ye s,status=yes,
directories=yes,copyhistory=yes',1)" >link</a>

change values to suit
e.g top=200,left=300 are position of window
play around turning YES to NO to see what happens
change yourpage.html to what ever page you want

bolloscript
12-07-2005, 11:52 AM
Ok, I'm at work atm so I will try that when I get home.
Thanks again mate, you're an absolute wizzard! :D

davidj
12-07-2005, 12:01 PM
you're an absolute wizzard

i know
but nobody has shown any appreciation by buying me
this ('http://www.bang-olufsen.com/web2/systems/product.asp?section=systems&sub=ms&prodid=12')

Creative Insanity
12-07-2005, 05:54 PM
You sure that is all you want dj? You would not like a car to go along with it would you LOL

bolloscript
12-07-2005, 06:08 PM
I'm about to try this now, but Im a bit nervous that it will do what I want now cos I'll gonna be skint for Xmas :lol: