Drop Down Notification Just Like FaceBook
Submitted by rinvizle on Saturday, July 2, 2016 - 12:54.
This tutorial we’re going to create a simple drop-down list using JavaScript and CSS. Which allows the user to select one value from a list. Drop-down list or menu provides a hierarchical overview of the subsections contained within the menu item that spawned it. All the subsections within a section of a site when you hover your mouse cursor over it.
Look for the example image below.
And for the CSS style.
So at this time you can now try to test this application by importing a database file drops.sql. And the source code is totally available in this site. And you could just copy and paste the code and modify it apart for yourselves. Hopefully you enjoy reading and you find it helpful.
Sample Code
Here is the example of JavaScript Syntax shown below.- $(function()
- {
- $(".view_comments").click(function()
- {
- var ID = $(this).attr("id");
- $.ajax({
- type: "POST",
- url: "viewajax.php",
- data: "msg_id="+ ID,
- cache: false,
- success: function(html){
- $("#view_comments"+ID).prepend(html);
- $("#view"+ID).remove();
- $("#two_comments"+ID).remove();
- }
- });
- return false;
- });
- });
- {
- margin: 0;
- padding: 0;
- }
- body {
- font-family: "Trebuchet MS", Helvetica, Sans-Serif;
- font-size: 14px;
- }
- a {
- text-decoration: none;
- color: #838383;
- }
- a:hover {
- color: black;
- }
- #menu {
- position: relative;
- margin-left: 30px;
- }
- #menu a {
- display: block;
- width: 140px;
- }
- #menu ul {
- list-style-type: none;
- }
- #menu li {
- float: left;
- position: relative;
- text-align: center;
- }
- #menu ul.sub-menu {
- position: absolute;
- left: -10px;
- z-index: 90;
- display:none;
- }
- #menu ul.sub-menu li {
- text-align: left;
- }
- #menu li:hover ul.sub-menu {
- display: block;
- }
- a
- { text-decoration:none; }
- .egg
- {
- position:relative;
- box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
- background-color:#fff;
- border-radius: 3px 3px 3px 3px;
- border: 1px solid rgba(100, 100, 100, 0.4);
- }
- .egg_Body{border-top:1px solid #D1D8E7;color:#808080;}
- .egg_Message{font-size:13px !important;font-weight:normal;overflow:hidden}
- h3{font-size:13px;color:#333;margin:0;padding:0}
- .comment_ui
- {
- border-bottom:1px solid #e5eaf1;clear:left;float:none;overflow:hidden;padding:6px 4px 3px 6px;width:431px; cursor:pointer;
- }
- .comment_ui:hover{
- background-color: #F7F7F7;
- }
- .dddd
- {
- background-color:#f2f2f2;border-bottom:1px solid #e5eaf1;clear:left;float:none;overflow:hidden;margin-bottom:2px;padding:6px 4px 3px 6px;width:431px;
- }
- .comment_text{padding:2px 0 4px; color:#333333}
- .comment_actual_text{display:inline;padding-left:.4em}
- ol {
- list-style:none;
- margin:0 auto;
- width:500px;
- margin-top: 20px;
- }
- #mes{
- padding: 0px 3px;
- border-radius: 2px 2px 2px 2px;
- background-color: rgb(240, 61, 37);
- font-size: 9px;
- font-weight: bold;
- color: #fff;
- position: absolute;
- top: 5px;
- left: 73px;
- }
- .toppointer{
- background-image:url(top.png);
- background-position: -82px 0;
- background-repeat: no-repeat;
- height: 11px;
- position: absolute;
- top: -11px;
- width: 20px;
- right: 354px;
- }
- .clean { display:none}
Add new comment
- 451 views