Results 1 to 8 of 8

Thread: Photo Album script pop-up controls

  1. #1
    Join Date
    Jul 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Photo Album script pop-up controls

    1) Script Title: Photo Album script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...photoalbum.htm

    3) Describe problem: I am trying to set the characteristics of the pop-up (_new). Basically, I just want the full-size image without scrollers/toolbars/etc in a window that fits it. My javascript knowledge is quite basic, and I tried transferring parts of the code from the PHP Photo Album that allow you to control the pop-up, but to no avail. You can see that in the code here: http://www.themidnighthours.com/index6.htm

    I would just use the PHP Photo Album script, but my hosting plan doesnt seem to support it and the images never load.

    This seems like it shouldnt be that complicated... but I'm rather ignorant.
    Any ideas?

  2. #2
    Join Date
    Apr 2006
    Posts
    429
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    try this link http://www.sitepoint.com/article/res...it-images-size

    is this what u want?

  3. #3
    Join Date
    Jul 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ya but im trying to work within the confines of the Photo Album script. How would I integrate that into it?

  4. #4
    Join Date
    Jul 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    oh and thanks for responding so quickly! i really appreciate it.

  5. #5
    Join Date
    Apr 2006
    Posts
    429
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Code:
    onClick="return popuplinkfunc(this)">
    is this a newly added feature?

    <edit>
    anyway, add this
    Code:
    function popuplinkfunc(imgsrc){
    if (popupsetting[0]==1){
    var popwin=open("pop.htm?"+imgsrc.href, "", popupsetting[1])
    popwin.focus()
    return false
    }
    else
    return true
    }
    within the
    Code:
    <script type="text/javascript">
    
    /***********************************************
    * Photo Album script- ? Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
    * This notice must stay intact for legal use
    ***********************************************/
    
    // more lines of code
    </script>
    and change the
    Code:
    var popupsetting=[1, "width=200px, height=200px, scrollbars, resizable"]
    with
    Code:
    var popupsetting=[1, "resizable=1,HEIGHT=200,WIDTH=200, scrollbars=1"]
    untried but should work theoretically
    Last edited by jr_yeo; 07-13-2006 at 02:36 PM.

  6. #6
    Join Date
    Apr 2006
    Posts
    429
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    one last thing
    create a new HTML file with this code inside it
    Code:
    <HTML>
    <HEAD>
     <TITLE>Fit the Pic Script</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">
     <script language='javascript'>
     document.write( "<img src='" + picUrl + "' border=0>" );
     </script>
    </BODY>
    </HTML>

  7. #7
    Join Date
    Jul 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Great, i got it working! www.themidnighthours.com
    thanks so much.

  8. #8
    Join Date
    Apr 2006
    Posts
    429
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    added feature if u want

    inside the pop.htm add the one in dark red :
    Code:
    document.write( "<img src='" + picUrl + "' border=0 onClick=javascript:window.close()>" );
    so that if the user clicks on the image the window closes

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
  •