RemoveEventListener On Do While
Apr 12, 2011Background: I have a menu which is created from an AJAX response - a php Do While loop whose size depends on the database content. Each click leads to a new sub-query. (The user gradually opens up all the options from header, to sub-header, to category.)
When you get to the category level, the click event fills a new div with thumbnail images, which you click to get product details. There is also a mouseover event on the category on the menu (not the thumbnail) which shows a few small images elsewhere on the page. However, I need to disable this mouseover event after the click. BUT... each category has a (unique) id generated by a combination of a static name category concatenated with a unique id taken from a database, (eg category1541, category1542 etc,) which is used to identify the product details correctly and bring up the correct images.
So here's the problem. After I have made the click event, I want to disable the mouseover event on all the category elements, not just the one I clicked.
Here's the function for FF browsers. (I will do the same later using DetachEvent later for IE.) I started using getElelmentByID, which didn't do what I wanted, so I changed to the window element.
If it is relevant, tinythumbs(this) is unique to the category.
I know this is complicated so I could post more code, but it's pretty big and full of php and the js file is referenced.