jQuery - expand/collapse all button, Internet Explorer problems
I have a custom tree structure type display. I have Expand all and Collapse all buttons, which are hooked up with the following simple jQuery.
$('#expandAll').click(function()开发者_JS百科 {
$("img[src='images/plus.gif']").parent().click();
});
$('#collapseAll').click(function() {
$("img[src='images/minus.gif']").parent().click();
});
This works fine in Firefox, but not in Internet Explorer 7 and presumably not in Internet Explorer 6 either. I'm unsure about Internet Explorer 8 since it is not supported where I work.
How can I make it work in Internet Explorer?
Have you tried using the $ within the selector, like
$("img[src$='images/minus.gif']").parent.click();
so that it matches the src
properties ending?
精彩评论