SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: open new window

  1. #1
    SitePoint Member
    Join Date
    Apr 2003
    Location
    sydney
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    open new window

    Can someoe show me how to open a new browser window eg(600x400) using a text link.

    I have tried the following code, it opens the new window but not in the right size (600x400).

    <script>
    function openWindow(){
    window.open('about:blank','something.php','scrollbars=yes,status=no,width=600,height=400,dependent=yes,directories=no,menubar=no,personal
    bar=no');
    return true;
    }
    </script>

    <a href="something.php?id='.$jobsheet.'&Customer='.$customer.'&JobName='.$jobname.'" target="_blank" onClick="return openWindow()"><img src="'.$image.'" ></a>

    any suggestions??

  2. #2
    SitePoint Enthusiast amherst's Avatar
    Join Date
    Jul 2003
    Location
    London UK
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is the code I use: seems to work fine for both placement and size of new window. I think the parameters are all easy enough to work out.

    <A HREF="" "#" onClick="window.open('filename.html','Max', 'toolbar=no,width=310,height=220,left=200,top=100, screenX=200,screenY=100,status=no,scrollbars=no, resize=no');return false">

    Click here for new window

    </a>

    Hope it helps
    http://www.riverwise.co.uk
    http://www.thamesbooks.co.uk



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •