Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-30-2011, 12:31 PM   PM User | #1
abdulqadir
New to the CF scene

 
Join Date: Jul 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
abdulqadir is an unknown quantity at this point
Tweaking Image Gallery

there's a free image gallery named "Apple-like Slideshow". I'm tweaking it a little bit so I can add many pictures. So what i will need is a horizontally scrollable thumbnail view. (the thumbnail bar will have nav buttons).

I wrote this:

var thumbwidth = 0;
var thumbpos = new Array();

// .menuItem is a class of li's of thumbs
$('.menuItem').each(function (index) {
thumbpos[index] = thumbwidth;
thumbwidth += $(this).width();
});

// #menu is a div containing the unordered list of thumbs
$('#menu').width(thumbwidth);

// #next is a div containing a button to scroll forward (to see next/more pictures)

$('#next').click(function () {
$('#menu').animate({ marginLeft: -60 + 'px' }, 450);
});

//#prev is a div containing a button to scroll backwards (to see previous thumbs)
$('#prev').click(function () {
$('#menu').stop().animate({ marginLeft: 60 + 'px' }, 450);
});

but when i click div with id ="next" it just animates margin-left: -60px. It does not respond when i click it the second time (ofcourse it wont). I'm having a very hard time because while and for loops aren't working.

Any help would be appreciated. Thanx in advance!!

oh and here's the link to the original image gallery i'm trying to tweak:
Code:
http://demo.tutorialzine.com/2009/11/beautiful-apple-gallery-slideshow/demo.html
abdulqadir is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:07 PM.


Advertisement
Log in to turn off these ads.