Marcel 57

I try to make a slider similar to the iPhone unlock Slider, that forwards to a linked site, when complete, and returns to its initial position when the slider wasn't dragged to the end.

So far I've tried those two tests, but i'm stuck on both.

The first is:

// First Example
var el = $('slideOne'),

// Create the new slider instance
var sliderOne = new Slider(el, el.getElement('.slider'), {
    steps: 20,  // There are 35 steps
    range: [8], // Minimum value is 8


Problem here is that i can't fire an event on (0) not on (20) aswell, i tried onComplete but this fires the function immediatly after the page is load!?

The second is:

$$('.textslider').setStyle('opacity', 0.8);

        snap: 0,
        container: 'slideOne',
        droppables: '.slidedrop1',

    onDrop: function(element, droppable, event){
        if (!droppable);
        else console.log(element, 'dropped on', droppable, location = 'index.php/kredite.html', event);

Problem here is , that the droppable don't work as fine as i hoped, sometimes i move the the slider on the invisible droppable, which indicates if the slider is dragged to the end, and nothing happens, sometimes it works fine, i think this may be due the different position of the cursor on the slider. and i can't get it done that it is only possible to slide horizontal , since it is that drag not the slider function, so i think this won be the proper way.

On both Tests, i didn't figured out who i could return the slider back to its initial position, with a slide Effect.

Are there some mootools cracks around who maybe could help me with this? Thanks already for the great ideas of y'all.

  • I'd recommend taking this question to StackOverflow, which if you're not famliar, is just like Doctype but for programming related questions. This kind of question will get more response there, and there are some really brilliant people that frequent it. Rob Nixon almost 10 years ago
  • Thanks for the recommendation, i'll try it there. Marcel almost 10 years ago