Home › Forums › JavaScript › jQuery Help – Image Slider
- This topic is empty.
-
AuthorPosts
-
September 7, 2010 at 2:19 pm #30184creativestableMember
Hi Folks!
I need some help tweaking a small piece of functionality on a site Im working on.
You can access the site here: http://mybcferriesmemories.trapeze.ca
username: test
password: testYou will be redirected to a gallery. Everything is working the way I want, except I would like to disable the previous button when on the first slide, and the next button while on the last. Ultimately, I just need a css class on the button when there isnt any more items so that I can remove the hover state.
Now, I am using a modified version of jcarousel lite and this functionality is SUPPOSED to be built in, but for some reason it is not working. You can see the modified jcarousel code here: http://groups.google.com/group/jquery-en/browse_thread/thread/2c7c4a86d19cadf9?pli=1
Any help is very much appreciated!
– Amy
September 10, 2010 at 12:49 pm #80147creativestableMemberHey Mark! Thanks for the reply :)
I originally had it loading via ajax but I couldn’t get the slide animation going :/
Am I missing something? Because I see no disabled class:
PREVIOUSNEXTSeptember 11, 2010 at 3:05 am #80069jamygoldenMemberThat’s a pretty complicated jQuery image slider lol. It’s pretty messy so I can’t really see what’s going on, also a plugin isn’t really necessary for something like this (I don’t think so at least). I’m about to do a tutorial on this, however I haven’t completed it yet.
What I would do is say (in javascript of course):
– When you click on previous
– If the <ul>’s left value is greater or equal to 0, do nothing, otherwise slide like normaland
– when you click on next
– If the <ul>’s left value is less or equal to -7406px;, do nothing, otherwise slide like normalHere is a snippet of my example – Where #gal-prev is the prev-button and #gallery is the <ul>
jQuery("#gal-prev").click(function(){
if(jQuery("#gallery").position().left < 0){
jQuery("#gallery").animate({left : "+=95px"});
}
return false;
});I’ll post a link to the completed example once I’m done with it if you still need help.
September 13, 2010 at 12:34 pm #79917creativestableMemberHi jamy_za!
Thanks for the feedback… definitely post the link to your tutorial or send to me via twitter :)
I know it’s really messy and complicated *hangs head in shame*. I have a lot to learn :P
-
AuthorPosts
- The forum ‘JavaScript’ is closed to new topics and replies.