Jul 25, 2008

Popup Window With Height And Width?

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > HTML, XML etc..

free web hosting

Popup Window With Height And Width?

Amezis
I will try to explain:

When clicking on the link, a pop-up window will be opened. I also want to have the width=300 and height=160 (just examples wink.gif )

Could someone give me a short code for that?

Reply

DoR
This is the code:

CODE

<html>
<head>
<script>
function popup(){
window.open('URL','window_name','width=300,height=160,scrollbar=1');
}
</script>
</head>
<body>

<a href='javascript:popup()'>popup!!</a>

</body>
</html>

Reply

Amezis
Thank you.

But if I want more than one different popup, how can I do that?

Reply

DoR
To open more than one popup, with one link, just copy inside the function popup(), the line window.open and use diferent window names.
Thats all.

If I that was usefull, vote me!.

Reply

Amezis
No, no... Not with one link. If I have [link 1] which opens popup 1, and [link 2] which opens popup 2... How can I do that?

Reply

DoR
The code modified for you.
CODE

<html>
<head>
<script>
function popup(link,window_name){
window.open(link,window_name,'width=300,height=160,scrollbar=1');
}
</script>
</head>
<body>

<a href='javascript:popup("URL1","window1")'>popup 1</a>
<br>
<a href='javascript:popup("URL2","window2")'>popup 2</a>
<br>
<a href='javascript:popup("URL3","window3")'>popup 3</a>
<!-- And so on... -->

</body>
</html>




Reply

Amezis
Great, but still a little thing: How can the different popups have different sizes?

Reply

DoR
The "popup 1" is width=300 and height=160
The "popup 1" is width=400 and height=300
The "popup 1" is width=600 and height=10


CODE

<html>
<head>
<script>
function popup(link,window_name,width,height){
window.open(link,window_name,'width='+width+',height='+height+',scrollbar=1');
}
</script>
</head>
<body>

<a href='javascript:popup("URL1","window1",300,160)'>popup 1</a>
<br>
<a href='javascript:popup("URL2","window2",400,300)'>popup 2</a>
<br>
<a href='javascript:popup("URL3","window3",600,10)'>popup 3</a>
<!-- And so on... -->

</body>
</html>


______________________________
If that was usefull, vote me!

 

 

 


Reply

FaLgoR
Could I do by this way?

CODE

<html>
<head>
<script>
function popup(){
window.open('URL','window_name','width=300,height=160,scrollbar=1');
}
function popup2(){
window.open('URL','window_name','width=300,height=160,scrollbar=1');
}
</script>
</head>
<body>

<a href='javascript:popup()'>popup!!</a>

<a href='javascript:popup()'>another popup!!</a>

</body>
</html>


?

Reply

Amezis
Thank you! Both of the codes are working biggrin.gif

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : popup, window, height, width

  1. Width Of Display Area Of Browser Window
    is there a formula? (6)
  2. Refresh Main Window By Clicking Link In Popup?
    (2)
    This is another refresh problem question. The project I'm doing uses tons of frames (I know,
    some of you will probably advise me not to use frames) and I'm having problems with refreshing
    the target frames. The problem is, I have a main page (main.html) that is a popup (so that I
    don't see the address bar and the other toolbar bits in my browser) and there are links in that
    page that when clicked also pops up a page. What I don't know is how to refresh the main page
    using a link in the other popup page. I've tried using this but this only works f....
  3. Ie Table Width In A Div Tag
    Table expands past screen at 100% (4)
    Hey everyone. I have been designing websites for a long time but i have recently decided to tryout
    the DIV layout technique instead of just using good old tables. However, this is the biggest problem
    i have come across. So I have a page where i need to have a table to display a whole bunch of
    details on armor in a game since the site is for players of final fantasy. However, when i do
    width="100%" so that the table expands the whole way to the side of the div so it looks the best it
    now will go past the edge and off the screen at 100%. Below is most of the code. Please h....
  4. Div Child Height Same Height As The Father
    how to set child height to be the same.. (2)
    I will try to explain myself as briefly as possible. I want have the next xhtml squeletone: CODE
    <html>  <head>  </head>  <body>  <div
    id="container">    <div id="header">      <div
    id="searchEngine">        <!-- Search Engine Markup >      </div>
       </div>    <div id="header2">    </div>    <div
    id="primarynav">        <!-- primary nav Markup >    </div>  
     <div id="content....
  5. Max Table Width
    (13)
    Well, I have a table that I don't want to be over 350 pixels in width - even on the largest
    screens. On small screens, the table will be smaller. But on large screens, I don't want the
    table to larger than 350 pixels... Is there a way to do that?....
  6. Table Width Help
    table width="100%" goes off screen (2)
    Hey everyone. My problem is that current i have a left menu and a right menu which are created using
    a div the properties listed below. Then i have a center section to my website where i have a table
    that i need to fill the remaining space on the screen (aka the space from the right side of the left
    menu to the left side of the right menu). However, when i set the table's width to 100%, it goes
    of the screen. Can anyone help me with this? If you look at my main page, the news section works but
    only because the text forces the table to its largest size and then wraps.....
  7. Setting A Maximum Table Height
    (3)
    How do I set a maximum table height? I tried height and max-height but neither worked. I need to
    have it a certain height because more than that height it adds a vertical scrollbar, which adds a
    horizontal scrollbar because I have an image that's pushing it. beeseven.trap17.com I want
    the table that the updates are in to be a certain height with a scrollbar there instead of making it
    above the page length and adding a main scrollbar.....
  8. Adding Width And Height To Page
    (8)
    how do you add width and height to your page? without adding it to your link you previously
    clicked... I mean, that the width and height should be included in the ORIGINAL page... i hope
    someone can help me with this... thanks in advance! /cool.gif' border='0'
    style='vertical-align:middle' alt='cool.gif' /> btw: i'm not that familiar with
    scripting.......

    1. Looking for popup, window, height, width

Searching Video's for popup, window, height, width
advertisement



Popup Window With Height And Width?



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE