JSFiddle

  • rahvaraamat

    Product page script

    $(document).ready(function() {
      $('.add_to_basket').click(function() {
        //console.log('https://www.rahvaraamat.ee/add-to-basket/');
        //__AtmUrls = window.__AtmUrls || [];
        $('#result').html(' https://www ...
  • Download text file button

    Test for crossbrowser solution in the browsers

    var BrowserDetect = {
      init: function() {
        this.browser = this.searchString(this.dataBrowser) || "Other";
        this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator ...
  • Image preloader #2 is the latest revision

    jQuery 1.9.1, HTML, CSS, JavaScript

    $(document).ready(function() {
      var container = $('#container');
      var width = container.width();
      var height = container.height();
    
      var image_params = {
        pos_x: 10,
        pos_y: 10 ...
  • Change banners and borders (with function Line)

    Check banner border render Without change there is border difference between

    var banner_sizes = ['300x250', '160x600', '728x90', '930x130', '980x180'];
    var border_sizes = ['1', '2', '3', '4', '5'];
    var border_radius = ['0','1', '2', '3 ...
  • Change banners and borders

    Check banner border render

    var banner_sizes = ['300x250', '160x600', '728x90', '930x130', '980x180'];
    var border_sizes = ['1', '2', '3', '4', '5'];
    var bannerwidth = 300;
    var bannerheight = 250 ...
  • Base64 encode and decode string

    Encode base64 string

    var Base64 = {
      // private property
      _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
      // public method for encoding
      encode: function(input) {
        var output = "";
        var chr1, chr2, chr3, enc1 ...
  • SHIFT key and rescale

    Press shift key and rescale object in the Konva library

    var $keysPressed = [];
    var $shiftCode = 16;
    var $stage = null;
    var $layer = null;
    var $group = null;
    var $rect = null;
    var $shifted = false ...
  • Validator of number format #5 is the latest revision

    jQuery 1.9.1, HTML, CSS, JavaScript

    $(document).ready(function() {
      $('#check').on('click', function() {
        var value = $('#maxcpm').val() || null;
        var answer = '';
        if (null !== value && 'undefined' !== typeof $('#maxcpm').val()) {
          value = $.trim(value);
          if ('' === value) {
            answer ...
  • Chekc invalid date

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

    function isInvalidDate(timestr) {
        var result = false;
        var dt=new Date();
        
        if (false === isNaN(parseInt(timestr))) {
        	var offset = 60 * 60 * 24 ...
  • Datepicker with date format #1 is the latest revision

    dd/mm/yyyy format

    $(document).ready(function() {
      var NumberOfMonth = function(month) {
        month = month + 1;
        if (10 > month) {
          return '0' + month;
        } else {
          return month;
        }
      };
    
      var ...