RemoveEventListener On Do While

Apr 12, 2011

Background: 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.

View 3 Replies


ADVERTISEMENT

RemoveEventListener With Anonymous Handler?

Jan 24, 2009

I'm writing a base class for a project and one of the class's prototypes encapsulates cross browser event listening. One point of confusion is that removeEventListener requires that you know the handler. I don't have this info because I'm creating anonymous functions, so how do I do it?Here's the code:

javascript Code:
Original
- javascript Code

[code]....

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved