javascript - How to i append CSS values in a dynamic table -
i'm using gwt table being generate dynamically lots of columns out horizontal scroll bar , scrollbar, need wrapper fixed width around table. gwt create container not adding width it.
to solve problem, i'm calculating width of screen , adding table wrapper, adding scroll bar table working weirdly.
- it adds scroll bar when move mouse near table
- it doesn't work when in resize table
i'm using live() works run time objects can't use click event.
here code.
$(function() { var screenwidth = $(window).width(); $('body').live("mouseover", function() { $('.scrollbar').css({ 'width' : (screenwidth) - 40 }); $("body").unbind("mouseover"); }); });
- use $('body').on("mouseover") if getting scrollbar can handle setting overflow none. if need change css dynamically can add / remove class , keep css separate code. practice.
Comments
Post a Comment