for the past few weeks i've been redesigning my site. i found this really cool javascript i want to use, but the problem is that the script is meant for sites that are aligned to the left. i wan to make i website aligned to the center.
here is the script:
var flash = document.getElementById('flashGallery');
flash.onmousemove = function(f){
f = f || window.event;
var x_f = getMouseX(f);
var image_f = Math.floor(x_f / 35) % 6;
setImage_f(image_f);
}
flash.onmouseout = function(f){
setImage_f(0);
}
function setImage_f(i_f){
document.getElementById('flashGallery').style.backgroundPosition = "0pt " + (-160 * i_f) + "px";
}
function getMouseX(f){
var posx_over_flash = 0;
if (f.pageX != undefined) {
posx_over_flash = f.pageX;
}
else if (f.clientX != undefined) {
posx_over_flash = f.clientX + document.body.scrollLeft
+ document.documentElement.scrollLeft;
}
return posx_over_flash;
}
the problem is that different browser sizes create different results. any suggestions on how to fix this








Sign In »
Register Now!
Help

MultiQuote