Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Jquery animation is not working for following code
HTML
<ul class="main_menu">
                            <li class="active"><a href="#home">Home</a></li>
                            <li><a href="#about" data-id="#about">About us</a></li>
                            <li><a href="#choose">Why choose us</a></li>
                            <li><a href="#services">Services</a></li>
                            <li><a href="#projects">Projects</a></li>
                            <li><a href="#contact">Contact Us</a></li>
                        </ul>


CSS
.main_menu {
    display: inline;
    li {
        float: left;
        list-style: none;
        margin-left: 32px;
        position: relative;
        padding-bottom: 5px;
        &:first-child {
            margin-left: 5px;
        }
    }
    a {
        text-decoration: none;
        color: @color_1;
        font-size: 14px;
        text-transform: uppercase;
        outline: none;
    }
    li.active {
        &:focus {
            border-bottom: 2px solid #C80813;
        }
        &:active {
            border-bottom: 2px solid #C80813;
        }
        border-bottom: 2px solid #C80813;
        &:hover {
            border-bottom: 2px solid #C80813;
        }
        &:after {
            content: '';
            position: absolute;
            top: 27px;
            right: 43%;
            border: 5px solid transparent;
            border-top-color: #C80813;
        }
    }
}


JavaScript
$(document).ready(function () {
$("ul.main_menu li").on("load", function (){
    $(this).show().animate({ marginTop: "80px" }, 1500 )
               .animate({ marginTop: "40px" }, 800 );
});
        
});


What I have tried:

I just did a animation but is not working
Posted
Comments
deepak.dubal 11-Aug-16 5:18am    
Do you want menu functionality? If yes then i can provide you ready code

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900