oi pessoal! bom dia! procurei pela web e nos tópicos aqui do scriptbrasil e não consegui encontrar uma solução pro meu problema! estou construindo um site com layout líquido que vai ter uma barra de scroll horizontal. Coloquei online aqui: http://www.6design.com.br/2010/sitedesenho.html (é só clicar em trabalhos e depois em álbum de figurinhas ekin) o scrollbar funciona bem sem redimensionar o browser, mas quando redimensiono, principalmente de um tamanho maior pra um menor, o scroll apresena problemas... A última foto não aparece até o fim :( alguém pode me dar uma ajudinha? esse é meu código (as2): barekin.useHandCursor = draggerekin.useHandCursor=false;
space = 20;
friction = 0.9;
speed = 4;
x = draggerekin._x;
top = mainekin._x;
bottom = mainekin._x+maskekin._width-mainekin._width-space;
draggerekin.onPress = function() {
drag = true;
this.startDrag(false, this._parent.x, this._y, this._parent.x+this._parent.barekin._width-this._width, this._y);
draggerekin.scrollEase();
};
draggerekin.onMouseUp = function() {
this.stopDrag();
drag = false;
};
barekin.onPress = function() {
drag = true;
if (this._parent._xmouse>this._x+this._width-this._parent.draggerekin._width) {
this._parent.draggerekin._x = this._parent._xmouse;
this._parent.draggerekin._x = this._x+this._width-this._parent.draggerekin._width;
} else {
this._parent.draggerekin._x = this._parent._xmouse;
}
draggerekin.scrollEase();
};
barekin.onMouseUp = function() {
drag = false;
};
movedraggerekin = function (d) {
if ((draggerekin._x>=x+barekin._width-draggerekin._width && d == 1) || (draggerekin._x<=x && d == -1)) {
clearInterval(myInterval);
} else {
draggerekin._x += d;
draggerekin.scrollEase();
updateAfterEvent();
}
};
up_btn.onPress = function() {
myInterval = setInterval(moveDragger, 100, -1);
};
down_btn.onPress = function() {
myInterval = setInterval(moveDragger, 100, 1);
};
up_btn.onMouseUp = down_btn.onMouseUp=function () {
clearInterval(myInterval);
};
MovieClip.prototype.scrollEase = function() {
this.onEnterFrame = function() {
if (Math.abs(dx) == 0 && drag == false) {
delete this.onEnterFrame;
}
r = (this._x-x)/(barekin._width-this._width);
dx = Math.round((((top-(top-bottom)*r)-mainekin._x)/speed)*friction);
mainekin._x += dx;
};
}; Brigadão :)