Side navigation
#6818 closed bug (invalid)
Opened July 22, 2010 04:27PM UTC
Closed July 25, 2010 04:22PM UTC
Last modified March 15, 2012 01:43PM UTC
Floating an image (<img>) kills its :visible selector
Reported by: | halil | Owned by: | |
---|---|---|---|
Priority: | Milestone: | 1.4.3 | |
Component: | selector | Version: | 1.4.2 |
Keywords: | visible, float, image, img | Cc: | |
Blocked by: | Blocking: |
Description
If we give an image float property in CSS like
#our-img { float: left; }
then
$("#our-img:visible")
returns nothing.
See the attachment or you can view the ok one at
http://demo.nette.com.tr/jquery-img-float/ok.html
and the erroneous one at
Attachments (2)
Change History (1)
Changed July 25, 2010 04:22PM UTC by comment:1
resolution: | → invalid |
---|---|
status: | new → closed |
jQuery defines an element to be visible if the offsetWidth (css_width + padding_width + border_width) and offsetHeight is not 0.
If a container has only floated elements and no padding/border, it will have zero width/height.
http://www.quirksmode.org/css/clearing.html
Your selector is on the img container,
so it's running afoul of that rule. Try one of the approaches mentioned in that article, or perhaps add some border/padding to the link element.