[英]How do I append CSS values in a dynamic table
I'm using GWT table which is being generate dynamically with lots of columns but with out horizontal scroll bar and to get the scrollbar, we need wrapper with fixed width around the table, but GWT do create container but not adding any width to it. 我正在使用GWT表,该表是动态生成的,具有许多列,但是没有水平滚动条,并且要获取滚动条,我们需要在表周围具有固定宽度的包装器,但是GWT确实会创建容器,但不向其添加任何宽度。
To solve the problem, I'm calculating width of screen and adding it to the table wrapper, which is adding scroll bar to the table but working weirdly. 为了解决该问题,我正在计算屏幕的宽度并将其添加到表包装器中,这是在表中添加滚动条,但工作异常。
I'm using Live()
as it works for run time objects, also I can't use click event. 我正在使用Live()
因为它适用于运行时对象,也不能使用click事件。
Here is the code: 这是代码:
$(function() {
var screenwidth = $(window).width();
$('body').live("mouseover", function() {
$('.scrollbar').css({
'width' : (screenwidth) - 40
});
$("body").unbind("mouseover");
});
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.