View Single Post
Old 04-06-2008, 23:11   #6 (permalink)
Steve
Pixalo Crew
 
Steve's Avatar
 
Join Date: Jan 2005
Location: An Englishman living in Germany
Posts: 17,120
Steve is a jewel in the rough
Steve is a jewel in the roughSteve is a jewel in the rough

Image editing O.K.
User's Gallery
Users Camera Equipment List
Re: Any javascript experts out there

The theory you have there is sound but in practice its more complicated. You need more variables as you will need to grab both the browser windows size, the offset co-ordinates to the spot where you want to display the image and then manipulate those variables with the ever changing image size variables...

the JS code that appears to be doing all that is this section...

PHP Code:
function floatSS(iX,iY,id){
var 
L=dD.getElementById?dD.getElementById(id):dD.all?dD.all[id]:dD.layers[id];        
this[id+'O']=L;if(dD.layers)L.style=L;L.nX=L.iX=iX;L.nY=L.iY=iY;
L.P=function(x,y){this.style.left=x+px;this.style.top=y+px;};L.Fss=function(){var pXpY;    
pX=(this.iX >=0)?0:nn?innerWidth:nn&&dH.clientWidth?dH.clientWidth:dB.clientWidth;    
pY=nn?pageYOffset:nn&&dH.scrollTop?dH.scrollTop:dB.scrollTop;    
if(
this.iY<0)pY+=nn?innerHeight:nn&&dH.clientHeight?dH.clientHeight:dB.clientHeight;    
this.nX+=.1*(pX+this.iX-this.nX);this.nY+=.1*(pY+this.iY-this.nY);this.P(this.nX,this.nY); 
As to how to alter it to recalculate a 'base' point so that portrait images extend upwards from the left bottom corner rather than from the center (needed to fix a starting point for both landscape and portrait orientation) I really don't know.

Sorry
__________________
An amateur will practice until they get it right,
A professional will practice until they don't get it wrong.
Steve is online now   Reply With Quote
 
Credit Score | Mortgage Calculator | Myspace Proxy | Mortgage Loans | Agriculture