$(".head-btn").click(function(){ $(this).toggleClass('opened'); $('.lang-select').toggleClass('hidden'); if ($(this).hasClass("opened")) { $.getJSON("https://how-to-screenshot.info/js/lang-mass.php", function(json){ string = '
'; sel_lang = $( '.head-btn' ).text(); $.each(json, function(i, item) { if (json[i].lang!=sel_lang) { string += ''+json[i].lang+'' }; }); string += '
'; $( string ).insertAfter( "#help" ); }); } else { $( ".lang-select" ).remove(); } }); $(".choose-device").click(function(){ $(this).toggleClass('opened'); if ($("div").is(".device-select")) { $( ".device-select" ).remove(); } else { var offset = $(this).offset(); $(".choose-device").append("
"+$(".devices").html()+"
"); } }); function link(dat){ switch (dat) { case 'vk': window.location.href="https://vk.com/share.php?url="+window.location; break; case 'ok': window.location.href="https://connect.ok.ru/offer?url="+window.location; break; case 'fb': window.location.href="https://www.facebook.com/sharer.php?src=sp&u="+window.location; break; case 'tw': window.location.href="https://twitter.com/intent/tweet?url="+window.location; break; case 'wa': window.location.href="https://api.whatsapp.com/send?text="+window.location; break; case 'tg': window.location.href="tg://msg?text="+window.location; break; case 'vb': window.location.href="viber://forward?text="+window.location; break; } }; $(".privacy-alert .close-btn").click(function () { document.cookie = "privacy=ok; path=/"; $( ".privacy-alert" ).remove(); }); $(".stars div").hover(function() { $(this).addClass("selected"); $(".stars .selected").prev(".stars div").addClass("selected"); $(".stars .selected").prev(".stars div").addClass("selected"); $(".stars .selected").prev(".stars div").addClass("selected"); $(".stars .selected").prev(".stars div").addClass("selected"); }, function() { $(".stars div").removeClass("selected") }), $(".stars div").click(function() { stars = $(this).data("stars"); $.ajax({ url: "https://how-to-screenshot.info/script/review.php", type: "post", data: { rating: stars, article: $("h1").text() }, success: function(t) { $(".stars div").remove(); $(".stars").html("

Thank you for rating!

"); }, error: function() { } }) });