PDA

View Full Version : Jump to Top Link



jay3ld
12-27-2005, 09:56 PM
http://dynamicdrive.com/dynamicindex5/jumptop.htm

That little script works just fine in all browsers but firefox 1.5
the link follows allong the bottom edge like it should but when a user changes the window size the browser does not refresh. :confused:
i have looked at it and messed around with firefox's javascript secruity settings and nothing has changed it to make it work.
any help as to why?

jscheuer1
12-28-2005, 05:14 AM
Well, the browser doesn't need to refresh, but it does need up to the moment information on positioning. Since the window dimensions are set for FF on page load, FF will always think the window is the same size it was when loaded. To change this, substitute this for the script's original function staticit():


function staticit(){ //function for IE4/ NS6
var w2=ns6? pageXOffset+(window.innerWidth-crosslogo.offsetWidth-20) : ietruebody().scrollLeft+w
var h2=ns6? pageYOffset+(window.innerHeight-crosslogo.offsetHeight-15) : ietruebody().scrollTop+h
crosslogo.style.left=w2+"px"
crosslogo.style.top=h2+"px"
}