/    Sign up×
Community /Pin to ProfileBookmark

pop-up window from a link in a nav bar

Hi,

I have a nav bar on my web site that is controlled by a file called ‘menu_trendy.js’ One of the links on the nav bar needs to open a pop up window to a specific size (617×400) and position on the screen (left=0,top=0).

However, I don’t know how to input a JavaScript instruction into the .js file to make this happen.

The link for the page in question currently looks like this:-

writeButton(loc+””,”form_order.htm”,”menu_trendy_b5″,81,18,”order form”,”_blank”,0);

The file is called ‘form_order.htm’.

I’d appreciate anyone’s help on this.

Thanks!

Riz

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@steelersfan88Feb 25.2004 — if i understand correctly: if you want a pop-up a certain size, use:

[code=php]<script>

function newWin(where, name, h, w, x, y) {
theWin = window.open (where, name, config='height='+ h +', width='+ w +', toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no')
theWin.moveTo(x,y)
theWin.focus
}

</script>[/code]
or if you want it in a js file, just remove the <script> and </script> tags.

call it like this (on any event, preferably onClick):

[code=php]newWin("/newWin.htm","mySite","400","600","0100","10")[/code]where mysite = web site,

mysite = name,

400 is height,

600 is width,

0 is x coordinate of new win, and

10 is y coordinate of new win

EDIT: If the site you are using is not on your server, you will get an access denied error message.
Copy linkTweet thisAlerts:
@riz-manauthorFeb 25.2004 — Thanks for your help but it doesn't seem to work - that, or I just don't understand how it's supposed to fit into the link.

I need a javascript that will launch a pop up window to a fixed window size and screen position.

It must fit within the following code -

writeButton(loc+"","form_order.htm","menu_trendy_b5",81,18,"order form","_blank",0);

I'm guessing it has to fit where it currently says 'form_order.htm'.

The pop up window will be the file "form_order.htm".

Thanks
×

Success!

Help @riz-man spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.12,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...