@maximifn
Пока ты спишь - твой враг качается

Почему скрипт добавляет скобки?

Есть код
(function($) {
    "use strict"

    $('a.page-scroll').bind('click', function(event) {
        var $anchor = $(this);
        $('html, body').stop().animate({
            scrollTop: ($($anchor.attr('href')).offset().top - 50)
        }, 600, 'easeOutQuad');
        event.preventDefault();
    });

    // Highlight the top nav as scrolling occurs
    $('body').scrollspy({
        target: '.navbar-fixed-top',
        offset: 51
    });

    // Closes the Responsive Menu on Menu Item Click
    $('.navbar-collapse ul li a').click(function() {
        $('.navbar-toggle:visible').click();
    });

    // Offset for Main Navigation
    $('#mainNav').affix({
        offset: {
            top: 100
        }
    })

    // Initialize and Configure Scroll Reveal Animation
    window.sr = ScrollReveal();
    sr.reveal('.sr-icons', {
        duration: 300,
        scale: 0.3,
        distance: '0px'
    }, 200);
    sr.reveal('.sr-button', {
        duration: 300,
        delay: 100
    });
    sr.reveal('.sr-contact', {
        duration: 300,
        scale: 0.3,
        distance: '0px'
    }, 300);

    // Initialize and Configure Magnific Popup Lightbox Plugin
    $('.popup-gallery').magnificPopup({
        delegate: 'a',
        type: 'image',
        tLoading: 'Loading image #%curr%...',
        mainClass: 'mfp-img-mobile',
        gallery: {
            enabled: true,
            navigateByImgClick: true,
            preload: [0, 1] // Will preload 0 - before current, and 1 after the current image
        },
        image: {
            tError: '<a href="%url%">The image #%curr%</a> could not be loaded.'
        }
    });

    $('.contact-form').on('submit', function(e) {
        var answer, form;
        e.preventDefault();
        if ($(this).validationEngine('validate', {
            promptPosition: 'topLeft',
            showOneMessage: true,
            maxErrorsPerField: 1,
            scroll: false
        })) {
            form = this;
            // var p = window.location.pathname.split( '/' )[1];
            // var order = 'ORDER'+(p==2 ? '2' : '1');
            answer = $(this).serialize();
            $.ajax({
                type: 'POST',
                cache: false,
                data: answer,
                url: '/php/submit.php',
                success: function(data) {
                    $.ajax({
                        type: "POST",
                        cache: false,
                        data: answer,
                        url: "/php/amocrm.php"
                    });
                    console.log('send->success')
                    $.arcticmodal('close');
                    $('#success-modal').arcticmodal();
                    yaCounterreachGoal( $(form).hasClass("form-0") ? "callback" : "order" );
                    ga('send', 'event', $(form).hasClass("form-0") ? "callbackform" : "orderform", 'send');
                    form.reset();
                },
                error: function(error) {
                    console.log('error: ' + error);
                }
            });
        } else {
            return false;
        }
    });

    $("input[name='request[Телефон]']").mask("+7 ( 999 ) 999 - 99 - 99");
    $('.phone-event').click(function() {
    // ga('send', 'event', 'phone', 'click');
    console.log('phone->click');
});

    $('.btn-callback').click(function() {
        $.arcticmodal('close');
        $('#callback-modal').arcticmodal();

    });
    $('.btn-calculation').click(function() {
        $.arcticmodal('close');
        $('#calculation-modal').arcticmodal();

    });
     $('.btn-portfolio').click(function() {
        $.arcticmodal('close');
        $('#portfolio-modal').arcticmodal();
    });
   
})(jQuery); // End of use strict

$( document ).ready(function() {
// Price Summ
    
    summ();
	//выпадающий список цен
	$("#acc-price>li>span").click(function() {
		$(this).toggleClass("act");		
		$(this).next().toggle( "300", function() {
		// Animation complete.
		});
	});
});

Сайт лендос на php данный скрипт не работает потому-что сам закрывает себя(!) - joxi.ru/BA05n7MsBQZegr
От чего это может происходить?
  • Вопрос задан
  • 105 просмотров
Решения вопроса 1
Stimulate
@Stimulate
могу
'use strict';
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы
29 мар. 2024, в 11:11
10000 руб./за проект
29 мар. 2024, в 10:00
10000 руб./за проект
29 мар. 2024, в 09:59
750 руб./в час