SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2001
    Location
    Las Vegas
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    need some help with javascript window pops...

    hello all, i'm having some difficulty setting the fine tuning on this page:

    http://www.westcoastfilmworks.com/riders.htm

    in the center of the page there are names that can be clicked to pop a new window thats got a predetermined size from the javascript code.....problem is, that they don't actually change in shape if i adjust the vertical size properties through the coding. right now i have them set to pop @ 620 pix high, but they're only coming up at about 580.....is there something messed up with my coding? thanks everyone for the help!

    -t

  2. #2
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    use this
    PHP Code:

    <script LANGUAGE="JavaScript">
    <!--

        var 
    nw
        
    function openAnyWindow(urlnamewh)
        {
            if (
    url == null || url == '' || name == null || name == '' || == null || == '' || == null || == '') return alert('missing variables from url, name, w or h\nurl=' url '\nname=' name '\nw=' '\nh=' h)
            
            if (!
    nw || nw.closed)
            {
                
    nw window.open(urlname,'\"width=' ',height=' +' \" ');

                if(!
    nw.opener)
                {
                    
    nw.opener
                
    }
                
    nw.document.close()
            } 
            else 
            {
                
    nw.focus()
            }
        }
    //-->
    </script> 
    just one thing though you have a lot of uneccessary html

    eg

    PHP Code:

        
    <TR>
            <
    TD>
                <
    IMG SRC="../images/wcf_top_bar_06.gif" WIDTH=150 HEIGHT=74></TD>
            <
    TD>
                <
    IMG SRC="../images/wcf_top_bar_07.gif" WIDTH=150 HEIGHT=74></TD>
            <
    TD>
                <
    IMG SRC="../images/wcf_top_bar_08.gif" WIDTH=150 HEIGHT=74></TD>
            <
    TD>
                <
    IMG SRC="../images/wcf_top_bar_09.gif" WIDTH=150 HEIGHT=74></TD>
            <
    TD>
                <
    IMG SRC="../images/wcf_top_bar_10.gif" WIDTH=149 HEIGHT=74></TD>
        </
    TR
    why dont you stick the images in an array and use a for loop to show the images links etc
    Last edited by Andrew-J2000; Apr 11, 2002 at 21:32.

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2001
    Location
    Las Vegas
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    getting closer...

    thanks andrew, i added in that different code.....which is giving me more height on the popup windows, but i still don't seem to have control over the width of them....i tried increasing and decresing the size variable in the line that actually pops each page, but they don't seem to affect it.....

    sorry for being such a js newbie

    -t

  4. #4
    That's Right. notepad_coder's Avatar
    Join Date
    Apr 2002
    Location
    Colorado
    Posts
    835
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can always try to resize it when it loads.

    new window >>
    PHP Code:
    <html>
      <
    head>
      </
    head>
      <
    body onLoad="resizeTo(width,height);">
        
    Body Stuff.
      </
    body>
    </
    html
    and that should set it to the right size.
    - the lid is off the maple syrup again!

  5. #5
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:

    <script LANGUAGE="JavaScript">
    <!--

        var 
    nw
        
    function openAnyWindow(urlnamewh)
        {
            if (
    url == null || url == '' || name == null || name == '' || == null || == '' || == null || == '') return alert('missing variables from url, name, w or h\nurl=' url '\nname=' name '\nw=' '\nh=' h)
          if (!
    nw || nw.closed)
          {
             
    nw window.open(urlname,'\"width=' ',height=' +' \" ');

            if(!
    nw.opener)
            {
              
    nw.opener
            
    }
            
    nw.document.close()
          } 
          else 
          {
            
    nw.focus()
          }
        }
    //-->
    </script>
    <a href="JavaScript:openAnyWindow('dizzydale.htm','1',100, 100);">
        <img border="0" src="http://www.westcoastfilmworks.com/images/riders/dizzydale.gif" width="142" height="25">
    </a> 
    copy this exactly because this works.


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
  •