Title: Custom js isn&#039;t working
Last modified: August 31, 2016

---

# Custom js isn't working

 *  Resolved [17Mark](https://wordpress.org/support/users/17mark/)
 * (@17mark)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/custom-js-isnt-working/)
 * Hi,
    Everything is ok but only javascript not working. I don’t know where can
   be problem, only it could be bad code. This is my CSS:
 *     ```
       html,body{
       	margin:0;
       	padding: 0;
       }
       html {
       	box-sizing: border-box;
       }
   
       *, *:before, *:after{
       	box-sizing: inherit;
   
       }
   
       .container:before,
       .group:before,
       .menu:before,
       .container:after,
       .group:after,
       .menu:after {
       	content: " ";
       	display: table;
   
       }
   
       .container:after,
       .group:after,
       .menu:after{
       	clear: both;
       }
   
       .container,
       .group,
       .menu{
       	*zoom: 1;
   
       }
   
       /* ----------------------> Header <-------------------------- */
       .menubar {
       	width: 100%;
       	height: 87px;
       	background: #cccccc;
   
       }
   
       .logo h1 {
       	float: left;
       	font-size: 50px;
       	margin: 0;
   
       }
   
       #menu-header
       	{
       	margin: 0;
       }
       #menu-header ul {
       	position: relative;
       	font-family: Arial;
       }
   
       nav ul ul.sub-menu {
       	position: absolute;
       	margin-top: 20px;
       	display: none;
       }
   
       nav ul li {
       	list-style-type: none;
       	margin: 0;
       	padding: 0;
       	display: inline-block;
       	float: left;
       }
   
       nav ul li a {
       	display: block;
       	color: #757575;
       }
   
       nav ul li ul li {
       	float: none;
       	display: block;
       }
   
       nav ul li a:hover{
       	border-bottom: 5px solid #2b81eb;
       }
   
       nav ul li ul li a {
       	padding: 10px 30px;
       	background: #cccccc;
       }
       nav ul li ul li a:hover{
       	border: none;
       	padding: 10px 30px;
       }
   
       nav ul li ul li a:first-child(){
       	background: url('');
       }
       ```
   
 * And this is my JS:
 *     ```
       jQuery(document).ready(function($){
   
           $( 'nav ul li a' ).hover(
               function(){
                   $(this).children('ul.sub-menu').slideDown(200);
               },
               function(){
                   $(this).children('ul.sub-menu').slideUp(200);
               }
           );
       });
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [zota marius](https://wordpress.org/support/users/zota-marius/)
 * (@zota-marius)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/custom-js-isnt-working/#post-6981964)
 *     ```
       jQuery(document).ready(function($){
   
           $( 'nav ul li a' ).hover(
               function(){
                   $(this).children('.sub-menu').slideDown(200);
               },
               function(){
                   $(this).children('.sub-menu').slideUp(200);
               }
           );
       });
       ```
   
 *  Thread Starter [17Mark](https://wordpress.org/support/users/17mark/)
 * (@17mark)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/custom-js-isnt-working/#post-6982038)
 * Thanks

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Custom js isn't working’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [17Mark](https://wordpress.org/support/users/17mark/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/custom-js-isnt-working/#post-6982038)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
