Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8

Thread: Timing Issue

  1. #1
    New Coder
    Join Date
    Jul 2002
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 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; 07-11-2002 at 08:17 PM.

  • #2
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    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.

  • #3
    New Coder
    Join Date
    Jul 2002
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    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.

  • #5
    New Coder
    Join Date
    Jul 2002
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    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?

  • #6
    New Coder
    Join Date
    Jul 2002
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Actually, resize doesn't work now either.

    This is weird.

  • #7
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    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.

  • #8
    New Coder
    Join Date
    Jul 2002
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    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!


  •  

    Posting Permissions

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