Home >Web Front-end >HTML Tutorial >Why does jquery modify CSS class not work?_html/css_WEB-ITnose

Why does jquery modify CSS class not work?_html/css_WEB-ITnose

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-24 12:11:101043browse


function showsubmenu()
{
$("#submenu_1").show();
$("#submenu_1").css("currentMenu");
$(this).css('currentMenu');
}

  
  

     


               
              
  • first

  •           
  • second

  •           
  • three

  •           
  • four

  •     



         
             

                     
  • first_1

  •                  
  • first_2

  •                  
  • first_3

  •              

       



$("#submenu_1").css("currentMenu");
$(this).css('currentMenu');

这两行怎么不起作用?没反应
currentNenu我定义在css文件时,包含进去了

只有$("#submenu_1").show();这个起作用


回复讨论(解决方案)

$("#submenu_1").addClass("currentMenu");
$(this).addClass('currentMenu');

添加 css类名  用 addClass

晕,不起作用

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Why is it invalid to set the cell height of a table using css? _html/css_WEB-ITnoseNext article:Why is it invalid to set the cell height of a table using css? _html/css_WEB-ITnose

Related articles

See more