{"id":4760,"date":"2017-11-17T04:52:37","date_gmt":"2017-11-17T04:52:37","guid":{"rendered":"http:\/\/a1webdesignteam.com\/blog\/?p=4760"},"modified":"2017-11-17T04:52:37","modified_gmt":"2017-11-17T04:52:37","slug":"notification-popup-using-css-and-jquery","status":"publish","type":"post","link":"https:\/\/a1webdesignteam.com\/blog\/notification-popup-using-css-and-jquery\/","title":{"rendered":"Notification Popup using CSS and Jquery."},"content":{"rendered":"<p>Are you looking for Facebook UI features, this post will explain you how to create a Facebook style notifications popup using Jquery, HTML and CSS, you will understand how CSS elements will helps to improve better web design. This is the most needed feature for social networking web projects to minimize and enrich the UX elements. Just few lines of code implement these concepts in your next project, take a quick look at this live demo.<\/p>\n<p><span class=\"post-body entry-content\"><br \/>\n<a id=\"downloadScript\" href=\"http:\/\/downloads.9lessons.info\/notifications_css.zip\" target=\"_blank\" rel=\"noopener\"><img src=\"https:\/\/lh3.ggpht.com\/_N9kpbq3FL74\/Sd31pMC1aHI\/AAAAAAAABg8\/UAWFBvpGO6Y\/down.png\" alt=\"\" align=\"absmiddle\" border=\"0\" \/>Download Script<\/a>\u00a0\u00a0\u00a0\u00a0\u00a0<a href=\"http:\/\/demos.9lessons.info\/notifications_css\/index.php\" target=\"_blank\" rel=\"noopener\"><img src=\"https:\/\/lh6.ggpht.com\/_N9kpbq3FL74\/Sd31o5XF8hI\/AAAAAAAABg0\/104nWJR7wro\/live.png\" alt=\"\" align=\"absmiddle\" border=\"0\" \/>Live Demo<\/a><\/p>\n<p><b>HTML Code<\/b><br \/>\nCreate an unordered HTML list for menu design.<br \/>\n<\/span><\/p>\n<div class=\"code\">&lt;ul id=&#8221;nav&#8221;&gt;<br \/>\n&lt;li&gt;&lt;a href=&#8221;#&#8221;&gt;Link1&lt;\/a&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;a href=&#8221;#&#8221;&gt;Link2&lt;\/a&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;a href=&#8221;#&#8221;&gt;Link3&lt;\/a&gt;&lt;\/li&gt;<br \/>\n&lt;li id=&#8221;notification_li&#8221;&gt;<br \/>\n&lt;a href=&#8221;#&#8221; id=&#8221;notificationLink&#8221;&gt;Notifications&lt;\/a&gt;<br \/>\n\/\/ Notification Popup Code&#8230;<br \/>\n&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;a href=&#8221;#&#8221;&gt;Link4&lt;\/a&gt;&lt;\/li&gt;<br \/>\n&lt;\/ul&gt;<\/div>\n<p><span class=\"post-body entry-content\">\u00a0<\/span><\/p>\n<div><img class=\"sri\" src=\"https:\/\/lh6.googleusercontent.com\/-IDNlemXf8x0\/VBENIwm96BI\/AAAAAAAALxI\/51Xaz_NI-y0\/s331\/links.png\" alt=\" Facebook Style Notification Popup using CSS and Jquery.\" \/><\/div>\n<p><span class=\"post-body entry-content\"><br \/>\n<b>CSS Code<\/b><br \/>\nAdd\u00a0<i>float:left<\/i>\u00a0for horizontal view.<br \/>\n<\/span><\/p>\n<div class=\"code\">#nav{list-style:none;margin: 0px;padding: 0px;}<br \/>\n#nav\u00a0li\u00a0{<br \/>\nfloat:\u00a0left;<br \/>\nmargin-right: 20px;<br \/>\nfont-size: 14px;<br \/>\nfont-weight:bold;<br \/>\n}<br \/>\n#nav\u00a0li\u00a0a{color:#333333;text-decoration:none}<br \/>\n#nav\u00a0li\u00a0a:hover{color:#006699;text-decoration:none}<\/div>\n<p><span class=\"post-body entry-content\"><br \/>\n<b>HTML Code<\/b><br \/>\nNotifications popup is divided into three parts are Notification Title, Notification Body and Notification Footer<br \/>\n<\/span><\/p>\n<div class=\"code\">&lt;li id=&#8221;notification_li&#8221;&gt;<br \/>\n&lt;span id=&#8221;<b>notification_count<\/b>&#8220;&gt;<b>3<\/b>&lt;\/span&gt;<br \/>\n&lt;a href=&#8221;#&#8221; id=&#8221;notificationLink&#8221;&gt;Notifications&lt;\/a&gt;<\/p>\n<p>&lt;div id=&#8221;<b>notificationContainer<\/b>&#8220;&gt;<br \/>\n&lt;div id=&#8221;<b>notificationTitle<\/b>&#8220;&gt;Notifications&lt;\/div&gt;<br \/>\n&lt;div id=&#8221;<b>notificationsBody<\/b>&#8221; class=&#8221;notifications&#8221;&gt;&lt;\/div&gt;<br \/>\n&lt;div id=&#8221;<b>notificationFooter<\/b>&#8220;&gt;&lt;a href=&#8221;#&#8221;&gt;See All&lt;\/a&gt;&lt;\/div&gt;<br \/>\n&lt;\/div&gt;<\/p>\n<p>&lt;\/li&gt;<\/p><\/div>\n<p><span class=\"post-body entry-content\">\u00a0<\/span><\/p>\n<div><img class=\"sri\" src=\"https:\/\/lh6.googleusercontent.com\/-U805AOiKgmk\/VBEtj4wVMiI\/AAAAAAAALxo\/CMxx_yXxI_I\/s512\/popup.png\" alt=\"Facebook Style Notification Popup using CSS and Jquery.\" \/><\/div>\n<p><span class=\"post-body entry-content\"><br \/>\n<b>CSS Code<\/b><br \/>\nTake a look at the following highlighted CSS properties.<br \/>\n<\/span><\/p>\n<div class=\"code\"><b>#notification_li<\/b><br \/>\n{<br \/>\nposition:relative<br \/>\n}<br \/>\n<b>#notificationContainer\u00a0<\/b><br \/>\n{<br \/>\nbackground-color: #fff;<br \/>\nborder: 1px solid rgba(100, 100, 100, .4);<br \/>\n-webkit-box-shadow: 0 3px 8px rgba(0, 0, 0, .25);<br \/>\noverflow: visible;<br \/>\nposition:\u00a0absolute;<br \/>\ntop: 30px;<br \/>\nmargin-left: -170px;<br \/>\nwidth: 400px;<br \/>\nz-index:\u00a0-1;<br \/>\ndisplay:\u00a0none;\u00a0\/\/ Enable this after jquery implementation<br \/>\n}<br \/>\n\/\/ Popup Arrow<br \/>\n<b>#notificationContainer<\/b>:before\u00a0{<br \/>\ncontent: &#8221;;<br \/>\ndisplay: block;<br \/>\nposition:\u00a0absolute;<br \/>\nwidth: 0;<br \/>\nheight: 0;<br \/>\ncolor: transparent;<br \/>\nborder: 10px solid black;<br \/>\nborder-color:\u00a0transparent transparent\u00a0white;<br \/>\nmargin-top: -20px;<br \/>\nmargin-left: 188px;<br \/>\n}<br \/>\n<b>#notificationTitle<\/b><br \/>\n{<br \/>\nfont-weight: bold;<br \/>\npadding: 8px;<br \/>\nfont-size: 13px;<br \/>\nbackground-color: #ffffff;<br \/>\nposition:\u00a0fixed;<br \/>\nz-index:\u00a01000;<br \/>\nwidth: 384px;<br \/>\nborder-bottom: 1px solid #dddddd;<br \/>\n}<br \/>\n<b>#notificationsBody<\/b><br \/>\n{<br \/>\npadding: 33px 0px 0px 0px !important;<br \/>\nmin-height:300px;<br \/>\n}<br \/>\n<b>#notificationFooter<\/b><br \/>\n{<br \/>\nbackground-color: #e9eaed;<br \/>\ntext-align: center;<br \/>\nfont-weight: bold;<br \/>\npadding: 8px;<br \/>\nfont-size: 12px;<br \/>\nborder-top: 1px solid #dddddd;<br \/>\n}<\/div>\n<p><span class=\"post-body entry-content\"><br \/>\n<b>Notification Count Bubble<\/b><br \/>\nCircle bubble for Notification count.<br \/>\n<\/span><\/p>\n<div class=\"code\"><b>#notification_count\u00a0<\/b><br \/>\n{<br \/>\npadding: 3px 7px 3px 7px;<br \/>\nbackground: #cc0000;<br \/>\ncolor: #ffffff;<br \/>\nfont-weight: bold;<br \/>\nmargin-left: 77px;<br \/>\nborder-radius: 9px;<br \/>\n-moz-border-radius: 9px;<br \/>\n-webkit-border-radius: 9px;<br \/>\nposition:\u00a0absolute;<br \/>\nmargin-top: -11px;<br \/>\nfont-size: 11px;<br \/>\n}<\/div>\n<p><span class=\"post-body entry-content\"><br \/>\n<b>Jquery<\/b><br \/>\nContains javascipt code. $(&#8220;#notificationLink&#8221;).click(function(){}- notificationContainer is the ID name of the popup div. Using jquery fadeToggel() showing popup based on click actions.<br \/>\n<\/span><\/p>\n<div class=\"code\">&lt;script type=&#8221;text\/javascript&#8221; src=&#8221;js\/jquery.min.1.9.js&#8221;&gt;&lt;\/script&gt;<br \/>\n&lt;script type=&#8221;text\/javascript&#8221; &gt;<br \/>\n$(document).ready(<b>function<\/b>()<br \/>\n{<br \/>\n$(&#8220;#notificationLink&#8221;).click(<b>function<\/b>()<br \/>\n{<br \/>\n$(&#8220;<b>#notificationContainer<\/b>&#8220;).fadeToggle(300);<br \/>\n$(&#8220;#notification_count&#8221;).fadeOut(&#8220;slow&#8221;);<br \/>\nreturn\u00a0false;<br \/>\n});<\/p>\n<p>\/\/Document Click hiding the popup<br \/>\n$(document).click(<b>function<\/b>()<br \/>\n{<br \/>\n$(<b>&#8220;#notificationContainer&#8221;<\/b>).hide();<br \/>\n});<\/p>\n<p>\/\/Popup on click<br \/>\n$(<b>&#8220;#notificationContainer&#8221;<\/b>).click(<b>function<\/b>()<br \/>\n{<br \/>\nreturn\u00a0false;<br \/>\n});<\/p>\n<p>});<br \/>\n&lt;\/script&gt;<b><\/b><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Are you looking for Facebook UI features, this post will explain you how to create a Facebook style notifications popup using Jquery, HTML and CSS, you will understand how CSS elements will helps to improve better web design. This is the most needed feature for social networking web projects to minimize and enrich the UX [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4762,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0},"categories":[6],"tags":[51],"_links":{"self":[{"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/posts\/4760"}],"collection":[{"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/comments?post=4760"}],"version-history":[{"count":0,"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/posts\/4760\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/media\/4762"}],"wp:attachment":[{"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/media?parent=4760"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/categories?post=4760"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/a1webdesignteam.com\/blog\/wp-json\/wp\/v2\/tags?post=4760"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}