Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jquery #78

Closed
ghost opened this issue Apr 12, 2015 · 4 comments
Closed

jquery #78

ghost opened this issue Apr 12, 2015 · 4 comments

Comments

@ghost
Copy link

ghost commented Apr 12, 2015

can you make this in jquery?

@tiesont
Copy link

tiesont commented Apr 12, 2015

Not sure what you mean. If you're asking for a re-write, I doubt that's going to happen. If you're looking to abstract Dragdealer behind a jQuery function, you can always do something like:

$.fn.dragDealer = function (options) {
    var _this = $(this);

    new Dragdealer(_this.get(0), options);
};

which would let you use this:

$('#some-valid-id').dragDealer({
    steps: 4,
    speed: 0.3,
    // etc.
});

If you wanted to be able to initialize multiple sliders, you'd want to wrap the inner bits in an each(), which might look like:

$.fn.dragDealer = function (options) {
    this.each(function(index, elem){
        var _this = $(this);

        new Dragdealer(_this.get(0), options);
    });
};

This is all completely untested, so it'd be up to you to discover any caveats.

@ghost
Copy link
Author

ghost commented Apr 12, 2015

this is close, I want to integrate( touch-ready image carousel.) with jquery slider

new Dragdealer('image-carousel', {
steps: 4,
speed: 0.3,
loose: true,
requestAnimationFrame: true
});

@tiesont
Copy link

tiesont commented Apr 13, 2015

May I ask why? I assume you're referring to https://jqueryui.com/slider/, which has a lot of overlap (functionally) with Dragdealer. If you just want the look of the jQuery UI slider, you can get that by either inspecting the generated elements with something like Firebug, or by digging into the CSS of whatever theme you're using.

@ovidiuch
Copy link
Owner

ovidiuch commented May 9, 2015

Closing this because the Dragdealer's mission was to be framework-agnostic from the beginning.

@ovidiuch ovidiuch closed this as completed May 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants