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
Release: 2016-06-24 12:11:10
Original
1031 people have browsed it


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

晕,不起作用

source:php.cn
Previous article:Why is it invalid to set the cell height of a table using css? _html/css_WEB-ITnose Next article:The display in Dreanweaver is different from the display in the browser. I don’t know what’s wrong. The border cannot be added to the div_html/css_WEB-ITnose
Statement of this Website
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
Latest Articles by Author
Latest Issues
Related Topics
More>
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template