PDA

View Full Version : Pro-Help with Thumbnail Viewer Script



Vampy
04-07-2008, 06:50 PM
1) Thumbnail Viewer Script

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

3) Ok, so I want to put the Thumbnail Viewer Script on my web-site. I combined it with another script here on DD, and it works just fine.

The problem is that I want to put it on my Joomla! Page, in the leftmenu. To do this, I need to make a iframe with the page where I have my script. This works, until the point where I click on a thumbnail.
The image opens withouth problems, but centers to the iFrame.
Now I need to get the opened image, centered to the main page of my web-site.
How can I do this?

Oh, and another problem is that when it opens the image, it isn't on top of all my main page content. Some images I have posted there go on top the image opened by Thumbnail Viewer Script.

This is the code that I think should be edited for the positioning, but I do not have a clue how. I am not good at Javascript.

centerDiv:function(divobj){ //Centers a div element on the page
var ie=document.all && !window.opera
var dom=document.getElementById
var scroll_top=(ie)? this.standardbody.scrollTop : window.pageYOffset
var scroll_left=(ie)? this.standardbody.scrollLeft : window.pageXOffset
var docwidth=(ie)? this.standardbody.clientWidth : window.innerWidth-this.scrollbarwidth
var docheight=(ie)? this.standardbody.clientHeight: window.innerHeight
var docheightcomplete=(this.standardbody.offsetHeight>this.standardbody.scrollHeight)? this.standardbody.offsetHeight : this.standardbody.scrollHeight //Full scroll height of document
var objwidth=divobj.offsetWidth //width of div element
var objheight=divobj.offsetHeight //height of div element
var topposition=(docheight>objheight)? scroll_top+docheight/2-objheight/2+"px" : scroll_top+10+"px" //Vertical position of div element: Either centered, or if element height larger than viewpoint height, 10px from top of viewpoint
divobj.style.left=docwidth/2-objwidth/2+"px" //Center div element horizontally
divobj.style.top=Math.floor(parseInt(topposition))+"px"
divobj.style.visibility="visible"
},

Please Help!

ddadmin
04-08-2008, 05:02 AM
Hmm an IFRAME basically is a separate browser window, and anything inside it can't venture outside the IFRAME and onto the main page...