Home >Web Front-end >JS Tutorial >Jquery.addClass is always invalid reason analysis_jquery

Jquery.addClass is always invalid reason analysis_jquery

WBOY
WBOYOriginal
2016-05-16 17:23:151565browse

Add the following to the setAdminTabs.js code:

Copy the code The code is as follows:

$("# adminTabs li").mouseover(function(){$(this).addClass("selectedTab")});

always does not work for the following reasons:
Copy code The code is as follows:

.selectedTab{background-color:White; border-bottom:1px}

Define two attributes, which exist in the admin.css file, as follows:
Copy the code The code is as follows:

#adminTabs ul li{ float:left; border: #E0E0E0 1px solid; margin-right:10px; padding:5px 10px; line-height:20px; width:80px; text-align:center ; background-color:#EEEEEE;}

Jquery makes it not work
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