Month: May 2016

Styling the default browser scroll bar using CSS

Default Scroll Bar Add the below CSS code to your stylesheet ::-webkit-scrollbar { width: 4px; } ::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); } ::-webkit-scrollbar-thumb { -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); } This is what you get, a more beautiful Scroll Bar   Lets add some round corners and increase the width ::-webkit-scrollbar { width: …

Difference between localStorage, sessionStorage and cookies

localStorage, sessionStorage and cookies are all client storage solutions which store data as key/value pairs in the browser. localStorage and sessionStorage both extend Storage. There is no difference between them except for the intended “non-persistence” of sessionStorage. sessionStorage maintains a separate storage area for each given origin that’s available for the duration of the page …

contenteditable DIV tag directive

Are you looking for a super simple WYSWYG editor and you don’t want to include any heavy library into your application. Then why not make your own using just a div. Take a look at the below directive. myApp.directive(“contenteditable”, function() { return { restrict: “A”, require: “ngModel”, link: function(scope, element, attrs, ngModel) { function read() …