使用自己定义的DIV的滚动条

基本思路:

 让DIV浮动起来,利用postion:fixed/absolute,设定height:100%  

  var $card=$("#cardDetail");
      $card.css({"width":"90%"});
      var wl=($(window).width()-$card.width())/2;
      var leftstr=wl+"px";
      var topstr=this.$root.$data.header_h+"px";
      $card.css({"position":"absolute","top":topstr,"height":"100%","overflow":"auto"});

posted @ 2018-08-28 14:16  FromScratch  阅读(210)  评论(0编辑  收藏  举报