Side navigation
#4334 closed bug (duplicate)
Opened March 11, 2009 09:47PM UTC
Closed May 10, 2009 04:10AM UTC
:visible not workgin on tr in IE 7
Reported by: | pete in atlanta | Owned by: | john |
---|---|---|---|
Priority: | minor | Milestone: | 1.4 |
Component: | selector | Version: | 1.3.2 |
Keywords: | :visible | Cc: | peter_vansteen@hotmail.com |
Blocked by: | Blocking: |
Description
we're using a toggle edit function that changes the visibility of a table row.
Here's the function:
flipEdit = function(num) {
var readId = "#read"+num;
var editId = "#edit"+num;
if ($(readId).is(":visible")) $(readId).fadeOut('fast', function() {$(editId).fadeIn();})
else $(editId).fadeOut('fast', function() {$(readId).fadeIn();})
//$("#example .round:visible").each(function(){alert(this.id);})
};
It works great on divs and tr's work in FF but not IE7.
What happens is that you can toggle to see the edit but can't toggle back to the read only.
Thanks and keep up the great work,
-PIA
Attachments (0)
Change History (5)
Changed March 11, 2009 11:55PM UTC by comment:1
Changed March 15, 2009 10:39AM UTC by comment:2
change this to
Sizzle.selectors.filters.hidden = function(elem){
return elem.offsetWidth === 0 || elem.offsetHeight === 0;
};
Sizzle.selectors.filters.visible = function(elem){
return elem.offsetWidth > 0 || elem.offsetHeight > 0;
that
Sizzle.selectors.filters.hidden = function(elem){
return "hidden" === elem.type ||
jQuery.css(elem, "display") === "none" ||
jQuery.css(elem, "visibility") === "hidden";
};
Sizzle.selectors.filters.visible = function(elem){
return "hidden" !== elem.type &&
jQuery.css(elem, "display") !== "none" &&
jQuery.css(elem, "visibility") !== "hidden";
};
Changed March 19, 2009 06:15AM UTC by comment:3
This has been fixed and closed in another ticket
http://dev.jquery.com/ticket/4374
This ticket should be closed
Changed March 19, 2009 06:29AM UTC by comment:4
I have the same problem with :visible and TRs on IE7. I solved it by changing my selector from 'tbody tr:visible' to 'tbody tr:not(:hidden)'. Logically, both selectors should produce the same node set, but do not. I suspect the difference is due to the issue described in ticket #4374. A change was submitted (#6286) which seems to make :visible == :not(:hidden) and it looks to me like the change will make :not(:hidden) suffer from the same problem on TRs. Perhaps the solution is to write a custom filter.
Can you put together a complete test case with html and script?