Jump to content

Utilizing Variable - JQuery


Cetanu

Recommended Posts

Okay, so.

 

$('#head li').mouseenter(function(){ 
var name = $(this).html(); 
$('#bubble.'+name+'').show(); 
});

$('#head li').mouseout(function(){ 
      $('#bubble').hide(); 
});

 

I'm trying to make the element whose class MATCHES the <li> class appear when the <li> is moused over. In that code, NAME is the variable that stores the information that matches up to the class...

 

...but I can't make the element appear! I know the variable is correct, so why doesn't the #bubble whose class = <li>'s information appear?

 

Thanks. :)

Link to comment
https://forums.phpfreaks.com/topic/202545-utilizing-variable-jquery/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.