The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript jQuery Help – Image Slider

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #30184

    Hi Folks!

    I need some help tweaking a small piece of functionality on a site Im working on.

    You can access the site here:
    username: test
    password: test

    You 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:

    Any help is very much appreciated!

    – Amy


    Hey 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:


    That’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 normal


    – when you click on next
    – If the <ul>’s left value is less or equal to -7406px;, do nothing, otherwise slide like normal

    Here is a snippet of my example – Where #gal-prev is the prev-button and #gallery is the <ul>

    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.


    Hi 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

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.