| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- const ham = document.getElementById('ham');
- ham.addEventListener('click', function () {
- console.log("open");
- document.body.classList.toggle('nav-is-toggled');
- });
- const ham1 = document.getElementById('closemenu');
- ham1.addEventListener('click', function () {
- console.log("close");
- document.body.classList.toggle('nav-is-toggled');
- });
- const links = document.querySelectorAll(".item-link");
- for (const link of links) {
- link.addEventListener("click", clickHandler);
- }
- function clickHandler(e) {
- e.preventDefault();
- const href = this.getAttribute("href");
- const offsetTop = document.querySelector(href).offsetTop - 81;
- scroll({
- top: offsetTop,
- behavior: "smooth"
- });
- }
- $(document).ready(function () {
- // active thumbnail
- $("#thumbSlider .thumb").on("click", function () {
- $(this).addClass("active");
- $(this).siblings().removeClass("active");
- });
- $(document).click(function (event) {
- var clickover = $(event.target);
- var _opened = $("body").hasClass("nav-is-toggled");
- if (_opened === true && !clickover.hasClass("navbar-collapse") && clickover.parents("#navbar").length == 0 && clickover.attr("id") != "ham" && clickover.parent().attr("id") != "ham") {
- document.body.classList.toggle('nav-is-toggled');
- }
- });
- })
- // $(document).ready(function () {
- // $('.blog').click(function (e) {
- // $(".submenu").toggleClass("show-menu");
- // $(".ftco-section").toggleClass("show-menu");
- // $(".main-archive").toggleClass("show-menu");
- // });
- // $(window).click(function (event) {
- // var $target = $(event.target);
- // var $parent = $target.closest(".submenu");
- // var $show = $target.closest(".blog");
- // if ($parent.length == 0 && $show.length == 0) {
- // var $menu = $('.submenu');
- // $menu.removeClass("show-menu");
- // var $menu1 = $('.ftco-section');
- // $menu1.removeClass("show-menu");
- // var $menu2 = $('.main-archive');
- // $menu2.removeClass("show-menu");
- // }
- // });
- // });
- // custom
- var lang;
- $(document).ready(function () {
- lang = getCookie("Language");
- console.log(lang);
- $(".setLang").on("click", function (event) {
- var lang = $(this).attr("lang");
- console.log(lang);
- document.cookie = "Language" + "=" + lang + ";path=/";
- $.ajax({
- url: "/Language/ChangeLanguage",
- data: {
- __RequestVerificationToken: $('input[name=__RequestVerificationToken]').val(),
- LanguageAbbrevation: lang
- },
- type: "POST",
- success: function (data) {
- console.log(data);
- location.reload(true);
- },
- error: function (req, st, error) {
- console.log("Error : " + error);
- }
- });
- });
- if (lang == null || lang == undefined) {
- lang = "fr";
- //document.cookie = "Language" + "=" + lang + ";"
- $(".setLang[lang='" + lang + "']").click();
- }
- console.log($(".setLang[lang='" + lang + "']").find("span:first").html());
- //$(".current-lang").html("<span>" + $(".setLang[lang='" + lang + "']").find("span:first").html() + "</span>");
- $("#langLabel").html(lang == 'en' ? 'EN' : 'TL');
- });
- function getCookie(ck_name) {
- var ck_value = document.cookie;
- console.log(ck_name);
- console.log(ck_value);
- var ck_start = ck_value.indexOf(" " + ck_name + "=");
- if (ck_start == -1) {
- ck_start = ck_value.indexOf(ck_name + "=");
- }
- if (ck_start == -1) {
- ck_value = null;
- } else {
- ck_start = ck_value.indexOf("=", ck_start) + 1;
- var ck_end = ck_value.indexOf(";", ck_start);
- if (ck_end == -1) {
- ck_end = ck_value.length;
- }
- ck_value = unescape(ck_value.substring(ck_start, ck_end));
- }
- return ck_value;
- };
- jQuery(document).ready(function () {
- //$(".menu-top")
- $("#loginRedirect").val("/");
- });
- $('body').on('click', '.is-invalid', function () {
- // do something
- $(".is-invalid").removeClass("is-invalid");
- });
- $(".login-dialog").click(function () {
- console.log("login click");
- $("#modalLogin").modal({ backdrop: 'static', keyboard: false });
- });
- $("input").keypress(function () {
- $(this).next(".invalid-feedback").hide();
- });
|