Benutzer:J*/Spielwüste2: Unterschied zwischen den Versionen

aus Kamelopedia, der wüsten Enzyklopädie
Zur Navigation springen Zur Suche springen
Zeile 5: Zeile 5:
  
 
<div style="height: 500px;"></div>
 
<div style="height: 500px;"></div>
 +
 +
 +
jQuery("body").append("<style> .tl_big {width:90px; height: 30px; border: 1px blue solid; position: absolute;} .tl_small {width:30px; height: 30px; border: 1px blue solid; position: absolute; } #tl_top {top: 0px; width: 100%;} #tl_left {left:0px;} #tl_right {right:0px;} #tl_bottom{bottom:0px; width: 100%;}</style>");
 +
 +
 +
jQuery("#bodyContent").find('*').mousemove(function (e) {
 +
  var ref = jQuery("#bodyContent");
 +
  var offset = ref.offset();
 +
  var left = e.pageX - offset.left;
 +
  var top = e.pageY - offset.top;
 +
  var height = ref.height();
 +
  var width = ref.width();
 +
  var n = 60;
 +
  var m = 2*n;
 +
 +
  if (left < m || left > width - m || top < m || top > height - m)
 +
    return;
 +
 +
  jQuery("#tl_top").height(top-n);
 +
  jQuery("#tl_bottom").height(height - n - top);
 +
  jQuery("#tl_left").width(left-n);
 +
  jQuery("#tl_right").width(width - n - left);
 +
 +
})

Version vom 8. Oktober 2011, 19:48 Uhr

T
L
R
B


jQuery("body").append("<style> .tl_big {width:90px; height: 30px; border: 1px blue solid; position: absolute;} .tl_small {width:30px; height: 30px; border: 1px blue solid; position: absolute; } #tl_top {top: 0px; width: 100%;} #tl_left {left:0px;} #tl_right {right:0px;} #tl_bottom{bottom:0px; width: 100%;}</style>");


jQuery("#bodyContent").find('*').mousemove(function (e) {

 var ref = jQuery("#bodyContent");
 var offset = ref.offset();
 var left = e.pageX - offset.left;
 var top = e.pageY - offset.top;
 var height = ref.height();
 var width = ref.width();
 var n = 60;
 var m = 2*n;
 if (left < m || left > width - m || top < m || top > height - m)
   return;
 jQuery("#tl_top").height(top-n);
 jQuery("#tl_bottom").height(height - n - top);
 jQuery("#tl_left").width(left-n);
 jQuery("#tl_right").width(width - n - left);

})