From: Radek Czajka Date: Mon, 30 Aug 2010 08:01:34 +0000 (+0200) Subject: sexy draggable marquee X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/742be9024255462893df993bfd11d6c51b41280f?ds=inline;hp=--cc sexy draggable marquee --- 742be9024255462893df993bfd11d6c51b41280f diff --git a/wolnelektury/static/js/catalogue.js b/wolnelektury/static/js/catalogue.js index 076ae4eeb..3057e152a 100644 --- a/wolnelektury/static/js/catalogue.js +++ b/wolnelektury/static/js/catalogue.js @@ -447,6 +447,19 @@ function serverTime() { return false; }); - $('marquee').marquee() + $('marquee').marquee().mouseover(function () { + $(this).trigger('stop'); + }).mouseout(function () { + $(this).trigger('start'); + }).mousemove(function (event) { + if ($(this).data('drag') == true) { + this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX); + } + }).mousedown(function (event) { + $(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft); + }).mouseup(function () { + $(this).data('drag', false); + }); + }); })(jQuery)