Advertisement
someone_

marquee.js

Nov 17th, 2012
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function($) {
  2.     $.ajax("/marquee.text.txt")
  3.         .done(function(text) {
  4.             $('div.marquee').html(text);
  5.             $('div.marquee').marquee("marquee").mouseover(function () {
  6.                 $(this).trigger('stop')
  7.             }).mouseout(function () {
  8.                 $(this).trigger('start')
  9.             }).mousemove(function (event) {
  10.                 if ($(this).data('drag') == true) {
  11.                     this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX)
  12.                 }
  13.             }).mousedown(function (event) {
  14.                 $(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft)
  15.             }).mouseup(function () {
  16.                 $(this).data('drag', false)
  17.             })
  18.         })
  19.         .fail(function(){
  20.             alert("There was a problem with fetching the marquee text.\nQuick! Call NigNog!");
  21.         });
  22. }(jQuery));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement