JSFiddle

  • YouTube Looper

    jQuery 1.7.2, HTML, CSS, JavaScript

     var tag = document.createElement('script');
     tag.src = "http://www.youtube.com/player_api";
     var firstScriptTag = document.getElementsByTagName('script')[0];
     firstScriptTag.parentNode ...
  • Show Your Current Location in Map #1 is the latest revision

    How to show your current location in map using Navigator Object.

    $("#GetInfo").click(function () {
        GetInfo();
    });
    
    function GetInfo() {
        if (navigator.geolocation) {
            navigator.geolocation.getCurrentPosition(ShowPosition);
        } else {
            x.innerHTML = "Geolocation is not supported ...
  • Pagination #2 is the latest revision

    Pagination service for views

    var Pagination = function(maxCount, $rootScope) {
        this.maxCount = maxCount;
        this.counter = 1;
        
        this.max = function() {
            return this.maxCount;
        };
        this.current = function ...
  • Character Counting Remaining on Textarea #1 is the latest revision

    text area with maxlenght that feeds how many characters the user has remaining

    $(document).ready(function() {
        var text_max = 99;
        $('#textarea_feedback').html(text_max + ' characters remaining');
    
        $('#textarea').keyup(function() {
            var text_length = $('#textarea').val().length;
            var ...
  • Google Maps Multiple Markers #1 is the latest revision

    jQuery 1.9.1, HTML, CSS, JavaScript

    $(document).ready(function () {
        var map;
        var elevator;
        var myOptions = {
            zoom: 1,
            center: new google.maps.LatLng(0, 0),
            mapTypeId: 'terrain ...
  • Regular Expression Test #2 is the latest revision

    Test for regular expression course work 4

    //var regex = /^vexillology$/i;
    
    var regex = /^20.*\PLJ$/i;
    
    function getValue()  {
        return document.getElementById("myinput").value;
    }
    
    function test() {
        alert(regex ...
  • Angular 2-way binding

    2-way skips a cycle of digest

    function Ctrl1($scope) {
        $scope.name = 'angular';
        $scope.counter = 0;
    
        $scope.myClick = function() {
            $scope.counter++;
            $scope.name = 'ctrl' + $scope.counter;
        }
    }
    
    angular ...
  • Show hide header depending on scroll direction. #7 is the latest revision

    jQuery 1.9.1, HTML, CSS, JavaScript

    $(window).scroll(
        {
            previousTop: 0
        }, 
        function () {
        var currentTop = $(window).scrollTop();
        if (currentTop < this.previousTop) {
            $(".info em").text("Up");
            $(".header").fadeIn();
        } else ...
  • Hide header on scroll down, show on scroll up

    jQuery (edge), HTML, CSS, JavaScript

    // Hide Header on on scroll down
    var didScroll;
    var lastScrollTop = 0;
    var delta = 5;
    var navbarHeight = $('header').outerHeight();
    
    $(window).scroll ...
  • Angular: Empty Fiddle #3 is the latest revision

    http://angularjs.org/

    var myApp = angular.module('myApp',[]);
    
    //myApp.directive('myDirective', function() {});
    myApp.directive('scrolly', function () {
        return {
            restrict: 'A',
            link: function (scope, element ...