Načítám...

JavaScript

  • JavaScript #2

    Copy-paste-fest prase s globálníma českoanglickýma proměnnýma

    var FinalCena = 0;
    var CenaArray = dataLayer[0].shoptet.cart;
    var CenaArrayLength = CenaArray.length;
    for (var i = 0; i < CenaArrayLength; i++) {
    var CenaQuent = CenaArray[i].quantity;
    var CenaSingle = CenaArray[i].priceWithVat;
    var CenaAll = CenaQuent * CenaSingle;
        console.log(CenaArray[i]);
    FinalCena = (FinalCena + CenaAll);
    var ResultCena = (FinalCena).toFixed(2).replace(' ', '').replace(',', '').replace('.', ',');
    console.log(FinalCena);
    console.log(ResultCena); 
  • JavaScript #1

    almost loop free jQuery!!

    if( $('#rozdelene-kategorie').length )    
    {
           $(".type-category .subcategories > li:nth-of-type(13)").insertBefore(".subcategories > li:nth-of-type(1)");
           $(".type-category .subcategories > li:nth-of-type(14)").insertBefore(".subcategories > li:nth-of-type(2)");
           $(".type-category .subcategories > li:nth-of-type(15)").insertBefore(".subcategories > li:nth-of-type(3)");
           $(".type-category .subcategories > li:nth-of-type(16)").insertBefore(".subcategories > li:nth-of-type(4)");
           $(".type-category .subcategories > li:nth-of-type(17)").insertBefore(".subcategories > li:nth-of-type(5)");
           $(".type-category .subcategories > li:nth-of-type(18)").insertBefore(".subcategories > li:nth-of-type(6)");
           $(".type-category .subcategories > li:nth-of-type(19)").insertBefore(".subcategories > li:nth-of-type(7)");
           $(".type-category .subcategories > li:nth-of-type(20)").insertBefore(".subcategories > li:nth-of-type(8)");
           $(".type-category .subcategories > li:nth-of-type(21)").insertBefore(".subcategories > li:nth-of-type(9)");
           $(".type-category .subcategories > li:nth-of-type(22)").insertBefore(".subcategories > li:nth-of-type(10)");
  • Žádné další prasokódy