javascript "identity" of objects
Moderator: General Moderators
javascript "identity" of objects
I have looked for this all over the place (including my ginormous javascript reference book). I can't find an operator or function/method that detects whether object a and object b live in the same place in memory... something like the is operator for python.
Last edited by Luke on Tue Jul 03, 2007 6:10 pm, edited 1 time in total.
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
OK, maybe you can answer the larger question then. I'm trying to open a sub-menu when a user clicks a link. I want the sub-menu to close all other open submenus. When I loop through each of the other submenus and close them. it also closes the one the user clicked. So how do I detect in the loop which one is the one the user clicked?
Code: Select all
$('.arrow').click(function(){
$('.arrow').each(function(){
if (this != the link the user clicked)
{
$(this).find('.close').click(); // close the submenu
}
});- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm