[RESOLVED] Object Required, Code 0... why?
I have a script that I have been modifying to allow for multiple expandable and collapsable divs.
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!
You're assignments are too big for the expand/shrink command.
and you have an assignment problem.
You don't need the var assignment in the shrink_all and expand_all functions.
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";
That error exists in all browsers.
Originally Posted by Chris Jacks
You're specifying a number range of 4, thereby addressing non-existent elements.
Try to come up with a more maintainable system.
Well, that's made me feel incredibly silly!
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!
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)