sticksy icon indicating copy to clipboard operation
sticksy copied to clipboard

Enable/disable with jQuery

Open levipadre opened this issue 5 years ago • 1 comments

Hi, thanks for the plugin, it's really great.

I was wondering if you can tell me how to enable and disable with jquery? I want to disable on smaller screen size (mobile).

$('.sticky-element').sticksy({
    topSpacing: 20,
    listen: true
});

Thanks

levipadre avatar Apr 19 '21 15:04 levipadre

I modified the existing jQuery demo to show enabling/disabling the plugin with jQuery (It's basically the same as with normal JS)

Demo

If you need to do it with a media query, you may need to use matchMedia

Pustur avatar Apr 20 '21 04:04 Pustur