jquery variable in css (left: - "DivWidth")
Hi, im in the process of coding up a sliding out menu. at the moment i am getting the div width in jquery like this
- var Menuwidth = $('.SidebarWrapper').width();
The width is 280px, but when developing new sites it could be different. this is obviously adjusted in the CSS file. How do i add the variable into CSS with a negative value equal to "Menuwidth"
- $(window).resize(function (){
- $(Sidebarwrapper).css({
- 'transition' : 'all 0.4s ease 0s',
- 'left' : '- + Menuwidth +' /*This needs to be -280px*/
- });
- });
Any help would be greatly appreciated.