作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
使用JQGrid 4.5.4
我需要在 JQGrid 的左侧和右侧都有垂直滚动条。
示例模型:
这可能吗?我进行了大量搜索,找到了两个水平滚动条的示例,但找不到 JQGrid 左右两侧都有两个垂直滚动条的示例。
最佳答案
我通过在 loadComplete 事件上添加一个小函数解决了这个问题。
此函数为左侧滚动条创建一个新的 div,然后同步两个滚动条。
loadComplete: function(){
var jqgridHeader = $(".ui-state-default.ui-jqgrid-hdiv");
// Add a new div with another div inside for the left scrollbar
jqgridHeader.after(
'<div id="leftScroll" style="z-index:1000; position:absolute; height:150px; overflow:scroll; width:17px;">'+
'<div id="leftScrollContent" style=" width:17px;"></div>' +
'</div>'
);
// Set to the new new div the sice of the jqgrid body
$("#leftScrollContent").css("height",($("#sortrows").height()));
var jqgridBody = $(".ui-jqgrid-bdiv");
// Syncronice both scrollbars
jqgridBody.scroll(function () {
$("#leftScroll").scrollTop(jqgridBody.scrollTop());
});
$("#leftScroll").scroll(function () {
jqgridBody.scrollTop($("#leftScroll").scrollTop());
});
}
*左侧滚动条与第一个网格列重叠
关于javascript - JQGrid 有两个垂直滚动条(左和右),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27512706/
我正在尝试让两张图片在背景中重复(一张阴影图片在右边,另一张在左边),就像这个网站一样。 到目前为止,我无法获得正确的 CSS 代码: http://www.elegantthemes.com/pre
好的,我正在尝试设置背景图片所以它就像 左边的图片和右边的图片不一样。 我试过用这个 body{ background: url(../Img/Background-01.png) center t
(哇,我讨厌标题) 嘿,我认为这是一个相当简单的问题。我目前尝试构建一个小的自制选项卡菜单。 (我知道那里有解决方案,但我想这样做是有原因的) 我想要三个按钮开始(一个在左侧,两个在右侧相邻)(示例中
我是一名优秀的程序员,十分优秀!