Results 1 to 10 of 10
  1. #1
    Join Date
    Feb 2003
    Location
    AR
    Posts
    2,381

    2 javascript questions...

    OK, background: On the page that I am doing, I am loading a new javascript window (popup) and the window adjusts to the size of the picture. Pictures are around 100K for the full version, so I want loading... text

    http://www.jonathantaylorrose.com/index.php?page=photos

    Question 1: How can I place the text, but have it disappear once the photo loads?
    Question 2: I want to place a 'Close Window' image under the large photo, however, the window has already been adjusted to the width and heigh of the image...therefore, placing the close window image under large photo actually shows nothing. Here is the javascript code.

    Code:
    <HTML>
    <HEAD>
     <TITLE>Jonathan Taylor Rose Photos</TITLE>
     <script language='javascript'>
       var arrTemp=self.location.href.split("?");
       var picUrl = (arrTemp.length>0)?arrTemp[1]:"";
       var NS = (navigator.appName=="Netscape")?true:false;
    
         function FitPic() {
           iWidth = (NS)?window.innerWidth:document.body.clientWidth;
           iHeight = (NS)?window.innerHeight:document.body.clientHeight;
           iWidth = document.images[0].width - iWidth;
           iHeight = document.images[0].height - iHeight;
           window.resizeBy(iWidth, iHeight);
           self.focus();
         };
     </script>
    </HEAD>
    <BODY bgcolor="#000000" onload='FitPic();' topmargin="0"  
    marginheight="0" leftmargin="0" marginwidth="0">
    <center><font color="#FFFFFF" size="3">Please wait for photo to load...</font></center>
     <script language='javascript'>
     document.write( "<img src='" + picUrl + "' border=0>" );
     </script>
    </BODY>
    </HTML>
    I need to know how to do a 'loading' text and how to place a 'close window' image underneath the large photo (something about adjusting iwidth and iheight to like height of image + however tall the close window image is I think)
    Thanks.

  2. #2
    Join Date
    Sep 2003
    Location
    UK
    Posts
    815
    Hi,

    I have a script which is a lot simpler and allows you to achieve what you require. With regards to loading text, when the box opens up with the larger image, just state at the top of the new pop-up window 'This image is quite large, please be patient while it loads' to outline the fact that it can take a short while to load, there is no real need to remove the text once the image is loaded, it just complicates matters.

    With regards to the close window text / button I would just added it at the bottom and expand the new pop-up window height / width to accommodate the new button / text.

    If you are not able to adjust the height / width of the new pop-up window with the current script you are using, mail me at sales - at - netspaceonline.net and I can send you one I use, works great, similar setup as yours though.
    Tahir Ahmed
    NetspaceOnline.net - Reliable Personal Web Site Hosting & Business Web Hosting Solutions!
    NSDomains.net - Our Dedicated Domain Registration & Management Portal!
    Reseller Hosting Solutions Linux Plesk 8 Control Panel Provding Quality Hosting Since 2001

  3. #3
    Join Date
    Feb 2003
    Location
    AR
    Posts
    2,381
    I want to expand the window to accomodate the height of the image....I stated that above. But I'm not a javascript programmer, so I have no idea at all how to do it.
    Kevin

  4. #4
    Join Date
    Feb 2003
    Location
    AR
    Posts
    2,381
    To elaborate on above post, the height and width of the popup change depending on the dimensions of the photo. that is why I can't just set a fixed width and height
    Kevin

  5. #5
    Join Date
    Sep 2003
    Location
    UK
    Posts
    815
    Hi Kevin,

    I will provide you with a JavaScript code that allows you to adjust the popup window to accommodate any width and height you like, please send me a PM.
    Tahir Ahmed
    NetspaceOnline.net - Reliable Personal Web Site Hosting & Business Web Hosting Solutions!
    NSDomains.net - Our Dedicated Domain Registration & Management Portal!
    Reseller Hosting Solutions Linux Plesk 8 Control Panel Provding Quality Hosting Since 2001

  6. #6
    Join Date
    Feb 2003
    Location
    AR
    Posts
    2,381
    Thank you for the script. However, it does exactly what I don't want to have to go through. It pops up a window, and I have to hardcode the height and width for each image. My script is good for me because it adjusts the ehight and width of the image automatically. I just need someone to help me add 15 to the height of it.
    Kevin

  7. #7
    Join Date
    Sep 2003
    Location
    UK
    Posts
    815
    No worries,

    Best of luck
    Tahir Ahmed
    NetspaceOnline.net - Reliable Personal Web Site Hosting & Business Web Hosting Solutions!
    NSDomains.net - Our Dedicated Domain Registration & Management Portal!
    Reseller Hosting Solutions Linux Plesk 8 Control Panel Provding Quality Hosting Since 2001

  8. #8
    Join Date
    Feb 2003
    Location
    AR
    Posts
    2,381
    can anybody help me? I think I need to do something like

    Code:
    window.resizeBy(iWidth, iHeight + '5');
    but that doesn't work...

  9. #9
    Join Date
    Feb 2003
    Location
    AR
    Posts
    2,381
    bump :-(...would like to get this fixed asap.

  10. #10
    Join Date
    Sep 2003
    Location
    UK
    Posts
    815
    Hi,

    Try asking here: http://www.youngcoders.com/index.php

    As its primarily a programming forum, maybe someone will be able to help you more quickly.
    Tahir Ahmed
    NetspaceOnline.net - Reliable Personal Web Site Hosting & Business Web Hosting Solutions!
    NSDomains.net - Our Dedicated Domain Registration & Management Portal!
    Reseller Hosting Solutions Linux Plesk 8 Control Panel Provding Quality Hosting Since 2001

Posting Permissions

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