| Page 1 of 1 | [ 2 posts ] |
|
Hi:
I'm having some difficulties Javascript-wise on IE7 (and IE6, for that matter), and I've manage to reduce it to a test case. Here's the code: Code: /*global YAHOO */ YAHOO.util.Event.onAvailable('optional',function () { var optional = YAHOO.util.Dom.get('optional'); function ShowHide(e,obj) { YAHOO.util.Event.preventDefault(e); if (YAHOO.util.Dom.getStyle(optional, 'display') == 'none') { YAHOO.util.Dom.setStyle(optional, 'display', 'table'); } else { YAHOO.util.Dom.setStyle(optional, 'display', 'none'); } } YAHOO.util.Event.on('optionalShowHide', 'click', ShowHide); YAHOO.util.Dom.setStyle(optional,'display', 'none'); }); When I go to the page on IE7, and click the link with the ID 'optionalShowHide', I get this error from IE7 & the Script Debugger: Quote: A Runtime Error has occured. Do you wish to Debug? Line: 232 Error: Could not get the display property. Invalid argument. It brings me to line 232 of dom.js, and the following line: Code: el.style[property] = val; It's part of the setStyle method. I don't know what's happening. Thoughts? You can see the afflicted page here, and the full code is in the base.js file linked to from that page which is quoted in full above. (The code works fine in FireFox 3 & Safari 3 & 4. It also fails in IE6, perhaps for the same reason.) Thanks! - geoff |
|
Well, I not only put this post in the wrong forum, but I found it's not a YUI problem, it's an IE7 problem. IE6 & 7 don't support "display:table", so it was choking on that. But unhiding the content by using "display:block" messed up the appearance on Safari & Firefox. So I changed "display:table" to "display:", and all is well with the world.
- geoff |
| Page 1 of 1 | [ 2 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group