targetfeatures ? Position

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
Armin
Advanced
Advanced
Posts: 16
Joined: Tue Sep 28, 2004 11:12 pm

targetfeatures ? Position

Post by Armin »

How can I target the position of a new window?

Where can I let the new window know where to "popup" ??

Thanks a lot for your help - Armin

aI("text=Musik;url=../se/music-se/popup-se.html;align=right; showmenu=Musik;image=../se/images-se/music/music-se.gif;itemwidth=14%;target=Musik;targetfeatures=width=200 height=150 toolbar=no location=no directories=no status=no menubar=no scrollbars=no resizable=no copyhistory=no;");
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

When placing code, please use the code button to open and close it.

You can position the window using the targetfeature.

Code: Select all

targetfeatures=all the stuff you have plus  left=10 top=10  or whatever placement you want;");

However you need to be aware of a couple of things. This will not work in all browsers because they don't all support it. Also, if the window is already open and it gets the new page gets loaded in it, it will not position differently from where it already is.

Ruth
Armin
Advanced
Advanced
Posts: 16
Joined: Tue Sep 28, 2004 11:12 pm

Thanks

Post by Armin »

Hi ruth,

Tnanks for your help. Like you have written it work in IE but not in Firework or Netscape.

Thanks - Armin
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

I think you need a function. I saw this and don't know if it will do what you want.

Code: Select all

var newwindow;
function poptastic(url)
{
	newwindow=window.open(url,'name','height=500,width=400,left=100,
  top=100,resizable=yes,scrollbars=yes,toolbar=yes,status=yes');

}


As to what you do with that function, where you put it, etc. I'm not sure. I think you put it in between the head tags and then in the menu link you'd call it, I think like this

Code: Select all

aI("text=item;url=javascript:newwindow('http://whatever/');");
Hopefully you can do something with this.

Ruth
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

:oops: This is incorrect

Code: Select all

aI("text=item;url=javascript:newwindow('http://whatever/');");
It should be

Code: Select all

aI("text=item;url=javascript:poptastic('http://whatever/');");
Sorry. It does work in Netscape.

Ruth
greengrass
Beginner
Beginner
Posts: 2
Joined: Thu Dec 23, 2004 3:26 pm

but the menu doesn't auto hide

Post by greengrass »

I use similar code to pop up a small dislogue box from a sub-menu item .
I get the pop to display correctly, but the menu/sub-menu/sub-menu item display
doesn't auto-hide.in the mail/original window!

Thoughts?

ps: I'm running the latest Milonic download in Foxfire 1.0
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi Armin,
Armin wrote:Like you have written it work in IE but not in Firework or Netscape.
Like Ruth mentioned, not all attributes are supported by all browsers. At least some versions of Netscape do not support the left= and top= window attributes in the window.open() method. So, it won't work with those.


Hi Greengrass,
greengrass wrote:I get the pop to display correctly, but the menu/sub-menu/sub-menu item display doesn't auto-hide in the mail/original window!
Try adding closeAllMenus(); to the top of the function you use to open your popup window.

Cheers,

Kevin
greengrass
Beginner
Beginner
Posts: 2
Joined: Thu Dec 23, 2004 3:26 pm

Post by greengrass »

Kevin:

Thanks for the prompt response. closeAllMenus() worked perfectly.
This thread might be usefully incorporated into the FAQ (IMOSHO)

regards
Post Reply