Reputation: 171
So I'm working on a Wordpress theme at the moment but I'm having issues getting the blog to style properly.
I'm using some basic jQuery to get the width of the div with the content and then have that set the width of the wrapper called '.main'.
var blogWidth = $("#blogImages").width();
var blogTotal = blogWidth;
var totalCanvas = blogTotal;
$('.main').css('width',totalCanvas);
It detects the proper width in Chrome but nothing else: http://leighmcd.com/blog/blog
The other issue was that I need the images to sit to the right of the content, even though they are in the same post so I put a div around the images and absolute positioned it. I have a feeling this may also be affecting the structure.
Any advice would be greatly appreciated.
Upvotes: 1
Views: 1243
Reputation: 93003
Try adding units to your .css()
call:
$('.main').css('width',totalCanvas+'px');
Upvotes: 0
Reputation: 58665
Use width to set the matched element's width:
$('.main').width(totalCanvas);
Upvotes: 2