View Full Version : Please help width javascript

04-15-2010, 05:40 PM
Hi, I have a little problem width my site, actually width scrolling gallery.

I'll try to explain it the best I can...

Site is based on java script, and everything is (all information) in the index.htm (menu, bio, contact, and 5 gallery's). From one point of menu to next (any other menu item) after click on menu, page simply scrolls (Horizontal) to that part of the page that is set up trough "core.js".

But, problem is in gallery's, because, they are also scrollable (Horizontal), and the length of each gallery ant the same. In 1st gallery a have 40 pic's, in second i have 10 pic's (ect..). This is where i come up width problems. In first gall, when i go to pic 40 (or any after 10th pic) everything works ok, but than when I click on my 2nd gall width 10 pic's I'm not on the beginning of the gall, instead I'm at the 40 pic even if that one don't exist, and to see the pictures in 2nd gall i have to click 50 time to go back to see it.

I think problem is in this part of the code:

var galleryCarusel = function(action){
var move = function(direction){
var moveTo = 0;
var stepSize = 795;
var currentPos = $('.galleryCarusel').scrollLeft();

var limitSize = (($(".imgSlideshow").size() / 3) * stepSize) - stepSize;
if(direction == 'next'){
if(currentPos < limitSize){
moveTo = currentPos + stepSize;
moveTo = 0;
} else if(direction == 'prev'){
if(currentPos > 0){
moveTo = currentPos - stepSize;
moveTo = 0;

scrollLeft : moveTo
}, 350, 'easeInOutExpo', function(){


if(action == 'next'){
}else if(action == 'prev'){

alert('act: ' + action + ' not bind');

If someone can help me it would be great...
Also... you can contact me over MSN...
Ask for it on pm...