Thursday, November 13, 2014

Popup DropDown Using jQuery.

I am using jQuery file in this example..

Ex :-)

<script type="text/javascript" src="jquery-1.11.1.min.js"></script>

<style type="text/css">

#container { background: #eee; margin: 20px; min-height: 300px; position: relative; }

#columns { position: absolute; top: 20px; left: 20px; padding: 8px; border-radius: 4px; border: 0px; background: #33b5e5; color: white; }

#selector { 
    position: absolute; 
    top: 60px; 
    left: 20px;
    background: #fff;
    border: 1px solid #999;
    border-radius: 5px;
    padding: 2px;
    font-size: 14px;
    color: #999;
    font-family: verdana;
    display: none;
}

#selector p{
margin: 5px;
}

</style>

<div id="container">
<button id="columns">Click on Me</button>
<div id="selector">
    <p><input type="checkbox"> MaHi</p>
    <p><input type="checkbox"> Sonal</p>    
    <p><input type="checkbox"> Aarti</p>
    <p><input type="checkbox"> Manisha</p>
</div>
</div>

<script type="text/javascript">

$(document).ready(function() {
    $('#columns').on('click', function() {
        $('#selector').fadeToggle(500);
    });
});

</script>


Output :)

1)

2)

No comments:

Post a Comment