hariseldon78
11-19-2010, 06:44 PM
Hello guys. I hope this has not been covered in the past, I tried to search a bit..
I am writing a memory game in javascript: you click on a card and it turns showing the other face of the card. Occasionally you will get some points, and i show those points in an animated div.
This div will move over the cards and that is the problem: when it is moving over the cards he steals the onclick event and the effect is that you cannot click the cards while it is over them.
This happens even if I bind an empty function to his own onclick (function() {return false;}). The cancelBubble and stopPropagation properties don't help me because the div is not parent nor children of the cards' divs, it is just a moved indipendent div.
I'm using the jQuery library and i'm quite new to javascript and html in general..
I am writing a memory game in javascript: you click on a card and it turns showing the other face of the card. Occasionally you will get some points, and i show those points in an animated div.
This div will move over the cards and that is the problem: when it is moving over the cards he steals the onclick event and the effect is that you cannot click the cards while it is over them.
This happens even if I bind an empty function to his own onclick (function() {return false;}). The cancelBubble and stopPropagation properties don't help me because the div is not parent nor children of the cards' divs, it is just a moved indipendent div.
I'm using the jQuery library and i'm quite new to javascript and html in general..