sexy draggable marquee
[wolnelektury.git] / wolnelektury / static / js / catalogue.js
index 076ae4e..3057e15 100644 (file)
@@ -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)