PDA

View Full Version : Position Content in Photo Album script v2.0



Nyetah
05-27-2008, 06:01 AM
1) Script Title: Photo Album script v2.0

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

3) Describe problem: I'm working with the photo album script on the following site: http://arts.ucsc.edu/faculty/watts/pages/noalbum.html

As you will see, I have the image links open to a full screen window. What I want to do is to position the content (the full size images) in the center and middle of the pop up page. Is this possible and if so...how? :-) I know enough to get my self stuck so don't assume I know too much in your explanation. :p

Your assistance is deeply appreciated...

cheers!

jscheuer1
05-27-2008, 02:05 PM
Give this a shot:


noalbum.onselectphoto=function(img, link){
if (link!=null) {//if this image is hyperlinked
var bob=window.open('', "", "fullscreen=1, status=1, resizable=1");
bob.document.write('<body style="margin:0;padding:0;overflow:auto;" onclick="self.close();"><center>'+
'<img alt="" title="Click to Close" border=1 src="'+link.href+'" style="visibility:hidden;">'+
'<script type="text/javascript">'+
'onload=function(){var h=window.innerHeight? window.innerHeight : document.body.clientHeight;'+
'if(h>document.images[0].offsetHeight) document.images[0].style.marginTop=h/2-document.images[0].offsetHeight/2+\'px\';'+
'document.images[0].style.visibility=\'visible\';}'+
'<\/script>');
bob.document.close();
}
return false //cancel default action when clicking on image, by returning false instead of true
}

Use it in place of your current noalbum.onselectphoto function.

Nyetah
05-27-2008, 06:03 PM
i am humbled by your help. it works perfectly!