JSFiddle

  • Blog- AngularJS-Simple-service #22 is the latest revision

    AngularJS 1.0.2, HTML, CSS, JavaScript, Sanitize, Resource

    angular.module('myApp', [])
        .factory('myService', function($q, $timeout) {
            var message = {};
            return {
                getMessage : function(){
                    var deferred = $q.defer();
                    
                    $timeout(function() {
                        message ...
  • Blog- AngularJS-Simple-service #2 is the latest revision

    AngularJS 1.0.2, HTML, CSS, JavaScript, Sanitize, Resource

    angular.module('myApp', [])
        .factory('myService', function($q, $timeout) {
            var message = {
                hello: 'hello world'
            };
            return {
                getMessage : function(){
                    return message;
                }
           };
        })
    
    function ControllerA ...
  • Blog- AngularJS-Simple-service #2 is the latest revision

    AngularJS 1.0.2, HTML, CSS, JavaScript, Sanitize, Resource

    angular.module('myApp', [])
        .factory('myService', function($q, $timeout) {
            var message = {
                hello: 'hello world'
            };
            return {
                getMessage : function(){
                    return message;
                    var deferred ...
  • Blog- AngularJS-Simple-service #5 is the latest revision

    AngularJS 1.0.2, HTML, CSS, JavaScript, Sanitize, Resource

    angular.module('myApp', [])
        .service('myService', function($q, $timeout) {
            var message = {};
            return {
                getMessage : function(){
                    var deferred = $q.defer();
                    
                    $timeout(function() {
                        message ...
  • Blog- AngularJS-Simple-service #50 is the latest revision

    AngularJS 1.0.2, HTML, CSS, JavaScript, Sanitize, Resource

    angular.module('myApp', [])
        .factory('myService', function($q, $timeout) {
            var getMessages = function() {
                var deferred = $q.defer();
                
                $timeout(function() {
                    message = 'Hello world ...
  • Elastic accordion. #12 is the latest revision

    No-Library (pure JS), HTML, SCSS, JavaScript

    <ul class="foo">
        <li class="foo__item">
            <h2>Foo</h2>
        </li>
        <li class="foo__item">
            <h2>Foo</h2>
        </li>
    </ul>
    
    
    <ul class="foo">
        <li class="foo__item">
            <h2>Foo</h2>
        </li>
        <li class="foo__item">
            <h2>Foo</h2>
        </li>
        <li class="foo__item">
            <h2>Foo</h2>
        </li>
    </ul>
    
    
    <ul class="foo">
        <li class="foo__item">
            <h2>Foo</h2>
        </li>
        <li class="foo__item">
            <h2>Foo</h2>
        </li>
        <li class="foo__item">
            <h2>Foo</h2>
        </li>
        <li class="foo__item">
            <h2>Foo</h2>
        </li>
        <li class="foo__item">
            <h2>Foo</h2>
        </li>
    </ul>
    
    
  • jquery tweets #1 is the latest revision

    jQuery 1.7.1, HTML, CSS, JavaScript

    $.fn.tweets = function(options) {
        $.ajaxSetup({ cache: true });
        var defaults = {
            tweets: 5,
            before: "<li>",
            after: "</li>"
        };
        var options = $.extend(defaults, options), i = 0 ...
  • Options nav

    No-Library (pure JS), HTML, CSS, JavaScript

    /*
    
    This looks like an unwieldy amount of CSS but:
    
    1) The HTML is tiny. The CSS only needs writing once ...
  • Slide/fade CSS3

    jQuery (edge), HTML, CSS, JavaScript

    var box = document.getElementById('box');
    
    function slide() {
        if (box.style.maxHeight != "100px") {
            box.style.maxHeight = "100px";
            box.style.opacity = "1 ...
  • Slide/fade CSS3

    jQuery (edge), HTML, CSS, JavaScript

    var box = document.getElementById('box');
    
    function slide() {
        if (box.style.maxHeight != "100px") {
            box.style.maxHeight = "100px";
            box.style.opacity = "1 ...