Airshow
WiFi Lounge Lizard
2,682 posts since Apr 2009
Reputation Points: 321
Solved Threads: 372
It's not clear what the nature of "running" is. ie. what is going on that needs to be stopped?
I think the solution may lie outside the switch-case structure.
ie. a condition that determines whether the switch-case block, in its entirety, is called.
Airshow
Airshow
WiFi Lounge Lizard
2,682 posts since Apr 2009
Reputation Points: 321
Solved Threads: 372
Ctoz,
I still don't understand enough to be able to help but can offer a critique of the code in general.
In no particular order:Use of global namespace can and should be completely avoided.
Event handlers are attached elsewhere, not in the javascript I can see; hopefully not in the HTML.
"var" is missing in some functions, thereby making unintentional globals.
makeLine1() to makeLine6() could, with a few simple associated changes, be made into one generalised function, saving about 200 lines of code.
Inefficient rediscovery of static DOM nodes, eg. $('#loadIt') , $('#bg1') , can be avoided.
Inefficient rediscovery of DOM nodes immediately after after insertion, eg. in addX() and addO() , can be avoided.
Use of setTimeout("string", xxx) should be avoided in favour of the setTimeout(function(){...}, xxx) form.
Obsolete code should be removed.
The whole thing would benefit from being refactored to better exploit javascript's object-oriented capabilities. In particular, there could be a hexGram() constructor with methods to give much of the bahaviour currently coded as global functions.
With efficient coding, there's no particular reason why Opera users should get a "rough ride".
Airshow
Airshow
WiFi Lounge Lizard
2,682 posts since Apr 2009
Reputation Points: 321
Solved Threads: 372
Where, d'you reckon, might one find a professional who'd be interested in taking the code to the level it deserves?
Well, in the first instance, you could ask me. I would be more than happy to discuss.Airshow
Airshow
WiFi Lounge Lizard
2,682 posts since Apr 2009
Reputation Points: 321
Solved Threads: 372