jQuery works best when the DOM element is at the center of the logic.
It seems like there are probably other parts to the code, but this
would be another way to write what is there and have the data hooked
to the datascape element. I've used plain properties on the DOM
element but you might want to use the $().data() method instead.

$('#datascape')
   .bind("mousemove", function(e){
      this.mouseX = e.pageX;
   })
   .hover(
      function(e) {
         this.interval = setInterval(function(){
            $.log('datascape.move : mouseX = ' + this.mouseX);
          }, 1000);
      },
      function(e){
         clearInterval(this.interval);
      }
   )
);

Reply via email to