Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Javascript for fixed height + width for window pop up

  1. #1
    Join Date
    Aug 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs down Javascript for fixed height + width for window pop up

    HI,

    COULD SOMEONE PLEASE TELL ME HOW TO EDIT THIS CDOE SO THAT WHEN I CLICK ON THE IMG LINK, THE POP UP WINDOW THAT OPENS CAN BE SET AT A FIXED WIDTH & HEIGHT? I AM ALSO INCLUDING THE ORIGINAL DREAMWEAVER FILE IN CASE U WANT TO SEE IT WORKING.

    THANKS!



    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Global_Medical Information List</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body><table width="244" border="1">
    <tr>
    <td><a href="http://iwha.gsk.com/globalmedicalinformation/globalmedinfo/treemenu/treemenu.html" target="_blank"><img src="http://iwha.gsk.com/globalmedicalinformation/globalmedinfo/treemenu/globalmicontact_graphic.jpg" width="244" height="45" border="0"></a></td>
    </tr>
    </table>

    </body>
    </html>

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    Quote Originally Posted by spancholi View Post
    <a href="http://iwha.gsk.com/globalmedicalinformation/globalmedinfo/treemenu/treemenu.html" target="_blank" ><img src="http://iwha.gsk.com/globalmedicalinformation/globalmedinfo/treemenu/globalmicontact_graphic.jpg" width="244" height="45" border="0"></a></td>
    </tr>
    </table>

    </body>
    </html>
    Code:
    <a href="link/path" onclick="window.open(this,newWin,'height=100+width=100')">Img</a>

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,134
    Thanks
    44
    Thanked 3,231 Times in 3,192 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by boogyman View Post
    Code:
    <a href="link/path" onclick="window.open(this,newWin,'height=100+width=100')">Img</a>
    That won't work unless newWin is defined or quoted. Also, although 'this' should refer to the href, it is best to write it out. And, without a return false, the link will also fire normally. I don't think using the + sign as you have would work either, but haven't tested that.

    I would favor something like so:

    Code:
    <a href="some.htm" target="_blank"
    onclick="window.open(this.href,this.target,'height=100, width=100');return false;">Img</a>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    lol thanks john. I knew it didnt look right after I had submitted it. Thanks for correcting my errors

  5. #5
    Join Date
    Aug 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi Guys,

    We're close but still not working. The javascript call is working fine now but my img tag linked with it, isnt working correctly. Can u look at this specific code and fix it with what u have suggested above??

    Should work then!

    <td><a href="http://iwha.gsk.com/globalmedicalinformation/globalmedinfo/treemenu/treemenu.html" target="_blank"><img src="http://iwha.gsk.com/globalmedicalinformation/globalmedinfo/treemenu/globalmicontact_graphic.jpg" width="244" height="45" border="0"></a></td>

  6. #6
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    what do you mean the image tag linked with it?

  7. #7
    Join Date
    Aug 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs down

    ok. can u see the attached zip file. it contains the original dreamweaver file in which i need to edit the window code. If u publish it, the pop up window that appears needs to be set at a fixed width & height. u will see what i'm talking about IF U PUBLISH MY DREAMWEAVE FILE.. please let me know if u are able to view it...

    THANKS, CANT WAIT!!

  8. #8
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    umm I am asking what about the image link... like what are you trying to accomplish?

    whatever you put in the href part of the anchor tag is what would be opened in the new window. if it is the dimensions of the new window you want to edit the script... below in blue are the values that John defaulted it to
    Code:
    <a href="some.htm" target="_blank"
    onclick="window.open(this.href,this.target,'height=100, width=100');return false;">Img</a>

  9. #9
    Join Date
    Aug 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ok never find, fixed it!! NOW CAN U JUST TELL ME HOW TO ADD RESIZABLE WINDOW OPTION TO YOUR CODE PLZ??

    <a href="some.htm" target="_blank"
    onclick="window.open(this.href,this.target,'height=100, width=100');return false;">Img</a>

    THX!!!

  10. #10
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,134
    Thanks
    44
    Thanked 3,231 Times in 3,192 Posts
    Blog Entries
    12

    Default

    Code:
    onclick="window.open(this.href,this.target,'height=100, width=100, resizable');return false;"
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •