[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/modules/jquery_ui/jquery.ui.old/demos/functional/templates/ -> ui.effects.easing.ex2.html (source)

   1  <div id="area" style="position: relative; width: 400px; height: 300px; border: 1px solid #bbb;">
   2      <img src="templates/images/white.gif" style="width: 400px; height: 300px;"/>
   3      <img id="target" src="templates/images/target.jpeg" style="position: absolute; left: 0px; top: 0px;"/>
   4  </div>
   5  <script type="text/javascript">
   6  function moveToHere(event, easing) {
   7      var area = $("#area");
   8      var target = $("#target");
   9      var offset = area.offset();
  10      var max = [area.width() - target.width(), area.height() - target.height()];
  11      var scroll = [document.documentElement.scrollLeft || document.body.scrollLeft,
  12          document.documentElement.scrollTop || document.body.scrollTop];
  13      target.animate({left: Math.max(0, Math.min((event.clientX + scroll[0]) - 
  14          offset.left - (target.width() / 2), max[0])),
  15          top: Math.max(0, Math.min((event.clientY + scroll[1]) - 
  16          offset.top - (target.height() / 2), max[1]))},
  17          2000, easing);
  18  }
  19  </script>


Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7