Results 1 to 5 of 5

Thread: image size

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Earth
    Posts
    762

    Cool image size

    hi i have some link on my page

    when some one click the the links
    i want to get 1st the image on server then the window open

    with the image size....

    i wrote this code but it's work some time ....

    function getwin(msrc)
    {
    var mm = new image()
    mm.src = msrc
    imgh = mm.height
    imgw = mm.width

    window.open('test1.htm?src='+msrc,'_blank','height='+imgh+',width='+imgw+',top=0,left=100')

    }
    can some help plz
    thanks
    Last edited by shahid; May 14th, 2003 at 04:15 AM.

  2. #2
    Junior Member
    Join Date
    May 2001
    Location
    Damascus - Syria
    Posts
    16
    not sure, but maybe u need to wait till the mm object is fully loaded from the server before reading its dimensions,
    like:

    while (mm.readyState!='complete') wend

    not sure, coz i'm not too good in java, but it should be something like this. u can avoid a deadlock by specifying a time out or some other condition...
    -/-

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Earth
    Posts
    762

    Cool

    Thanks about the tip....

    but is it possible to know that the image has been download completely.

  4. #4
    Junior Member
    Join Date
    May 2001
    Location
    Damascus - Syria
    Posts
    16
    yes, that's what i was saying,
    when the image is loaded completely, it's state would be 'complete':

    img.readyState=='complete'


    check the msdn for the img object properties:
    http://msdn.microsoft.com/library/default.asp
    -/-

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Earth
    Posts
    762

    Cool

    thank you so much

Posting Permissions

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



Click Here to Expand Forum to Full Width