Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Jul 2007
    Posts
    18
    Member #
    15547
    Ok so I know that all I have to do is use the "_blank" code in HTML to make the link open in a new window but what if I want the window to be something like 150px tall by 300px wide? Is there some javascript I can add to the code to make the link open the window in a new window that is that size? If so what would the code look like?

  2.  

  3. #2
    Junior Member
    Join Date
    Jul 2007
    Posts
    18
    Member #
    15547
    Ok I have been looking around and I came up with this...

    Code:
    <a href="#" onclick="window.open('audio_files/healthscope012907a.mp3','width=400,height=200,scrollbars=no');">Detoxification Part 1</a>
    It opens the file in the new window but the window is not resized or anything and still has scrollbars? Is there an error in my code?

  4. #3
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Many browsers disable the manipulation of many window features by default nowadays, because it's intrusive and potentially dangerous. Nonetheless, I'm not sure if passing a string as the second parameter works (I don't remember, haven't used window.open in many years).

  5. #4
    Senior Member imagn's Avatar
    Join Date
    Jul 2007
    Location
    Los Angeles
    Posts
    156
    Member #
    15594
    Here's the little function we use to open a custom sized popup:

    > JAVASCRIPT <
    function openwin(URL,theHeight,theWidth,addScroll) {
    var nXpos = (screen.availWidth - theWidth) / 2;
    var nYpos = (screen.availHeight - theHeight) / 2;
    var win = window.open(URL, 'popupWin', 'top=' + nYpos + ',left=' + nXpos + ',screenY=' + nYpos + ',screenX=' + nXpos + ',height=' + theHeight + ',width=' + theWidth + 'toolbar=0,scrollbars=' + addScroll + ',location=0,statusbar=0,menubar=0');
    win.focus();
    }

    > HTML <
    <a href="#" onClick="openwin('new_window.htm','455','430','no' );">MY LINK TEXT</a>


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 02:49 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com