.wrapAll('
') // Float left to display horizontally, readjust .slides width .css({ 'float' : 'right', 'width' : slideWidth }); // Set #slideInner width equal to total width of all slides $('#slideInner').css('width', slideWidth * numberOfSlides); // Insert controls in the DOM $('#slideshow') .prepend('Clicking moves left') .append('Clicking moves right'); // Hide left arrow control on first load manageControls(currentPosition); // Create event listeners for .controls clicks $('.control') .bind('click', function(){ // Determine new position currentPosition = ($(this).attr('id')=='rightControl') ? currentPosition+1 : currentPosition-1; // Hide / show controls manageControls(currentPosition); // Move slideInner using margin-left $('#slideInner').animate({ 'marginLeft' : slideWidth*(-currentPosition) }); }); // manageControls: Hides and Shows controls depending on currentPosition function manageControls(position){ // Hide left arrow if position is first slide if(position==0){ $('#leftControl').hide() } else{ $('#leftControl').show() } // Hide right arrow if position is last slide if(position==numberOfSlides-1){ $('#rightControl').hide() } else{ $('#rightControl').show() } } });

Threads of the Fate

Информация о пользователе

Привет, Гость! Войдите или зарегистрируйтесь.


Вы здесь » Threads of the Fate » Партнеры » TriptiaKak


TriptiaKak

Сообщений 1 страница 2 из 2

1

Your way of explaining the whole thing in this piece of writing is truly nice, every one can simply be aware of it, Thanks a lot.

0

2

Hello there! I could have sworn I've visited your blog before but after going through a few of the articles I realized it's new to me. Regardless, I'm certainly pleased I discovered it and I'll be bookmarking it and checking back frequently!

0


Вы здесь » Threads of the Fate » Партнеры » TriptiaKak


Рейтинг форумов | Создать форум бесплатно