I have a script that I have been modifying to allow for multiple expandable and collapsable divs.
It works fine in both IE8 and Firefox 3.6. The only problem is that in IE8, the "Expand All" link generates a javascript error down towards the bottom-left of the window that when opened indicates an error of Object Required, Code 0.
If using IE8 you can see the line number on which it suggests (possibly incorrectly) there is an error.
From previous searches on this site for similar posts it sounds like it could be an issue with the way I'm referring to DIVs. I have tried many varations to no avail.
Can anyone offer any suggestions? It would be nice if I could get rid of this one!
var elm_short = document.getElementById('item_' + i + '_short').style.display = "none";
var elm_long = document.getElementById('item_' + i + '_long').style.display = "inline";
var elm_linkshort = document.getElementById('item_' + i + '_linkshort').style.display = "none";
var elm_linklong = document.getElementById('item_' + i + '_linklong').style.display = "inline";
You don't need the var assignment in the shrink_all and expand_all functions.
I have a script that I have been modifying to allow for multiple expandable and collapsable divs.
It works fine in both IE8 and Firefox 3.6. The only problem is that in IE8, the "Expand All" link generates a javascript error down towards the bottom-left of the window that when opened indicates an error of Object Required, Code 0.
That error exists in all browsers.
You're specifying a number range of 4, thereby addressing non-existent elements.
Try to come up with a more maintainable system.
Where used, return should be executed unconditionally and always as the last statement in the function.
That's my signature, it's not part of the damn post!
I severe case of having one's mind elsewhere and not being able to see the most simple and obvious solutions to a problem.
Logic Ali, JMRKER, thanks very much for the prompt replies!
I completely forgot (and failed to notice) that I had put the "forced" count in there from another test. I have replaced with my counter again, which I believe addresses your comments JMRKER re more maintainable.
A great example for future posters... if you know you're not focussed. Just wait until your mind has cleared then look again!
Bookmarks