Can Javascript recognize a CSS width?
May 10, 2007 12:51 PM
Subscribe
CSS/JSP/Javascript Filter: I'm creating a widget which parses RSS via JSP and Javascript. This widget will allow users to include an RSS feed in their sidebar, but I'd like the widget to appear differently depending on the sidebar size. Is this possible to create an if statement determinant on the sidebar css class/id without know the class/id names?
I have my widget width set to 100%, so it will inherit the width of the class in which it's placed. However, if a user has a sidebar smaller than a certain width, I'd like to show an alternate view. The widget shows an image floating on the left, then headline and short description of a story to the right of the image. If the width of the sidebar is smaller than my min-width, I'd like the headline and description to move under the photo rather than to the right. Can I create an if statement which will recognize the inherited width without knowing the class/id name? Is this possible?
The feed is parsed via JSP and is displayed via a Javascript include.
Thanks for any ideas.
posted by captaindistracto to technology (4 comments total)
1 user marked this as a favorite
posted by jenkinsEar at 1:02 PM on May 10, 2007