首页javascriptopacityjQuery Style - 如何获取滚动条顶部偏移量...

jQuery Style - 如何获取滚动条顶部偏移量...

我们想知道如何获取滚动条顶部偏移量。...

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.9.1.js'></script>
<style type='text/css'>
#menu div {
  opacity: 0.7;
}
</style>
<script type='text/javascript'>
$(window).load(function(){
    $("#menu DIV").hover(
      function () {
        $(this).css({ opacity: 1 });
          console.log($(this));
      },
      function () {
       $(this).css({ opacity: 0.4 });
      }
    );
});
</script>
</head>
<body>
  <div id="menu">
    <div>Testing...</div>
  </div>
</body>
</html>