Web Analytics Made Easy -
StatCounter Timing Issue - CodingForum

Announcement

Collapse
No announcement yet.

Timing Issue

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Timing Issue

    For some reason this does not work. If I place an alert box in before the last line, it works fine. Also, is this the correct code to maximize a window?

    Thanks

    Code:
    function f_Pic(str_data)
    {
    	var T = window.open('./hi.html','Window_PictureID','menubar=no,status=no,location=no,toolbar=no,hotkeys=no,resizable,width=screen.width,height=screen.height');
    	T.resizeTo(screen.availWidth,screen.availHeight);
    	T.moveTo(screen.width-screen.availWidth,screen.height-screen.availHeight);
    	T.focus();
    
    	T.document.imgMainPicture.src=str_data;
    }
    Last edited by Hawk; Jul 11, 2002, 02:17 PM.

  • #2
    doesn't work, because you're trying to access the picture, before the page has finished loading, so the picture doesn't actually exist yet. try this:


    function f_Pic(str_data)
    {
    var T = window.open('./hi. html','Window_PictureID','menubar=no,status=no,loc
    ation=no,toolbar=no,hotkeys=no,resizable,width=scr
    een.width,height=screen.height');
    T.resizeTo(screen.availWidth,screen.availHeight);
    T.moveTo(screen.width-screen.availWidth,screen.height-screen.availHeight);
    T.focus();
    T.str_data = str_data;
    T.onload = function() {
    this.document.imgMainPicture.src=this.str_data;
    }
    }
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

    Comment


    • #3
      Thanks for the replied John.

      That was the feeling that I had. I knew that the error came up was because the image has not been loaded yet but I did not know how to wait until the load finish.

      Anyway, the error is suppressed but the picture is not showing either.

      Comment


      • #4
        use an alert to make sure that str_data is what you think it is. also, if i remember correctly, IE can be picky about relative urls. try using an absolute url.
        bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

        i am a loser geek, crazy with an evil streak,
        yes i do believe there is a violent thing inside of me.

        Comment


        • #5
          Thanks for your replied again.

          Actually, I used the OnResize event and that worked.

          By any chance do you know how to maximize a window?

          Comment


          • #6
            Actually, resize doesn't work now either.

            This is weird.

            Comment


            • #7
              windows can't be maximized. the best you can do is make them as big as the screen, which isn't worth it, in my opinion.

              using the onresize event, wouldn't work. you'd have to use the onload event for this.
              bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

              i am a loser geek, crazy with an evil streak,
              yes i do believe there is a violent thing inside of me.

              Comment


              • #8
                John,

                Thanks for your help again.

                I found out what happen. Your code worked fine. I reposition the script before the closing body tag and all is well now.

                You make sure you have a good day now!

                Comment

                Working...
                X