1

Possible Duplicate:
Detecting width: auto in jQuery

Using jQuery, how do we find out <div>s whose width had not been explicitly set up in CSS, regardless inline or non-inline. For example:

#outer-box {
  width: 100px;
}
#inside-box {
  /* width isn't set explicitly. */
  background-color: #000;
}

<div id="outer-box">
   <div id="inside-box">...</div>
</div>

I'd like to get a hold of only the div#inside-box based on the fact its width wasn't explicitly defined via the CSS.

Community
  • 1
  • 1
moey
  • 10,587
  • 25
  • 68
  • 112
  • 1
    This might give you an idea: http://stackoverflow.com/a/1212815/681807 – My Head Hurts Jan 11 '12 at 09:13
  • 1
    I put together a demo for your question at http://jsfiddle.net/sCG7V/ Have I understod your question correctly? – Stefan Jan 11 '12 at 09:28
  • 1
    Similar question - http://stackoverflow.com/questions/5000108/how-can-i-tell-if-a-particular-css-property-is-inherited-with-jquery – Gaurav Gupta Jan 11 '12 at 09:37
  • +1 for @Stefan for making the jsFiddle demo. By the way, how do you see the output of `console.log` in jsFiddle? – moey Jan 11 '12 at 10:01
  • 1
    @Siku-Siku.Com `console.log` shows it´s output in the browser console. Use Chrome or Firefox (with Firebug), hotkey F12. It can also be possible to view in IE but that´s not as easy. – Stefan Jan 11 '12 at 10:03
  • This is already asked [here](http://stackoverflow.com/questions/3557718/detecting-width-auto-in-jquery). According to the accepted answer, there is no way to do it. – kgiannakakis Jan 11 '12 at 09:41

0 Answers0