O
O
obraz462016-01-16 12:04:40
JavaScript
obraz46, 2016-01-16 12:04:40

Why does everything restart when I click the “order site” button?

Here is the site

aedd70996bdb49d3911261e90d94c8a8.png

$(document).click(function(e){
var e = e || window.event, 
x = e.srcElement || e.target;
if (x != $('.popup') && !$(x).parents(' .popup').size() ) {
$('.popup').fadeOut();
$('#overlay').remove('#overlay');
}
});

$(function () {
    //script for popups
    $('a.show_popup').click(function () {
        $('div.'+$(this).attr("rel")).fadeIn(500);
        $("body").append("<div id='overlay'></div>");
        $('#overlay').show().css({'filter' : 'alpha(opacity=80)'});
        return false;               
    }); 

    $('a.close').click(function () {
        $(this).parent().fadeOut(100);
        $('#overlay').remove('#overlay');
        return false;
    });

    //script for tabs
    $("div.selectTabs").each(function () {
        var tmp = $(this);
        $(tmp).find(".lineTabs li").each(function (i) {
            $(tmp).find(".lineTabs li:eq("+i+") a").click(function(){
                var tab_id=i+1;
                $(tmp).find(".lineTabs li").removeClass("active");
                $(this).parent().addClass("active");
                $(tmp).find(".tab_content div").stop(false,false).hide();
                $(tmp).find(".tab"+tab_id).stop(false,false).fadeIn(300);
                return false;
            });
        });
    });
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Владимир Ио, 2016-01-16
@obraz46

Вместо return false;
пишите

('a.show_popup').click(function (e) {
        ......
        e.preventDefault();               
    });

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question