Open kkkkh opened 2 years ago
问题: 1、案例中luckysheet组建的父元素不是body,而是一个div的容器中,此div设置固定高度并且有滚动条的时候; 2、当点击工具栏更多时,将更多工具栏显示出来时,我发现更多工具栏<div id="luckysheet-icon-morebtn-div">定位不准确,这是因为: 2-1、top的计算是基于 Store.infobarHeight + Store.toolbarHeight + $("#" + Store.container).offset().top + $("body").first().scrollTop();
<div id="luckysheet-icon-morebtn-div">
Store.infobarHeight + Store.toolbarHeight + $("#" + Store.container).offset().top + $("body").first().scrollTop()
src/controllers/resize.js
morediv = '<div id="luckysheet-icon-morebtn-div" class="luckysheet-wa-editor" style="position:absolute;top:'+ (Store.infobarHeight + Store.toolbarHeight + $("#" + Store.container).offset().top + $("body").first().scrollTop()) +'px;right:0px;z-index:1003;padding:5.5px;visibility:hidden;height:auto;white-space:initial;"></div>';
2-2、<div id="luckysheet-icon-morebtn-div">是append到body中,以body为父元素,进行定位造成的,而lucksheet的父元素此时不是body;
<div width="100%" height="300" style="overflow-y:scroll"> <div height="500" width="100%"></div> <div id="luckysheet"></div> </div>
<div width="100%" height="300" style="overflow-y:scroll">
<div height="500" width="100%"></div>
<div id="luckysheet"></div>
</div>
问题: 1、案例中luckysheet组建的父元素不是body,而是一个div的容器中,此div设置固定高度并且有滚动条的时候; 2、当点击工具栏更多时,将更多工具栏显示出来时,我发现更多工具栏
<div id="luckysheet-icon-morebtn-div">
定位不准确,这是因为: 2-1、top的计算是基于Store.infobarHeight + Store.toolbarHeight + $("#" + Store.container).offset().top + $("body").first().scrollTop()
;src/controllers/resize.js
morediv = '<div id="luckysheet-icon-morebtn-div" class="luckysheet-wa-editor" style="position:absolute;top:'+ (Store.infobarHeight + Store.toolbarHeight + $("#" + Store.container).offset().top + $("body").first().scrollTop()) +'px;right:0px;z-index:1003;padding:5.5px;visibility:hidden;height:auto;white-space:initial;"></div>';
2-2、
<div id="luckysheet-icon-morebtn-div">
是append到body中,以body为父元素,进行定位造成的,而lucksheet的父元素此时不是body;