На сайте все работает кроме ссылок. Ссылки работают после удаления строки подключения файла скрипта .js .Файл важный и без него никак.
подключение
сам файл
var doc = document;
// disable dragstart on images and links
var images = doc.getElementsByTagName('img');
var hrefs = doc.getElementsByTagName('a');
for (var i=0; img = images[i++];) {
img.ondragstart = function() { return false; };
}
for (var i=0; href = hrefs[i++];) {
href.ondragstart = function() { return false; };
}
// jQuery
$(document).ready(function() {
// Ajax forms
$('.form-main', this).on('submit', function(e) {
$.ajax({
type: 'post',
url: 'mail.php',
data: $(this).serialize(),
success: function () {
$('.success-submit').slideToggle();
$('.success-submit').animate({opacity: 1}, 500);
setTimeout(function() {
$('.modal-inner').scrollTop($('.modal-inner').height() + 9999);
}, 500);
setTimeout(function() {
$(".form").trigger("reset");
}, 2000);
},
error: function () {
$('.error-submit').show();
$('.error-submit').animate({opacity: 1}, 500);
}
});
e.preventDefault();
});
$('.top-menu a').each(function () {
if (this.href == location.href) $(this).parent().addClass('actual');
});
$('.symptoms li').wrapInner("");
$('.toggle-mnu').on('click', function() {
$(".toggle-mnu").toggleClass('on');
$('.top-menu').slideToggle();
});
$('.slider-comments').bxSlider({
nextText: '',
prevText: '',
pager: false
});
$('.serv-slide').bxSlider({
nextText: '',
prevText: '',
auto: true,
pause: 6000
});
$('.progress-slider').bxSlider({
controls: true,
nextText: '',
prevText: '',
pager: false
});
function resizeScreen(){
if ($(window).width() < 992) {
$(".name img").css("display", "block");
$(".cont-wrap img").css("display", "block");
$(".short-about").css("background-image", "none");
}
}
function resizeScreenback() {
if ($(window).width() > 992) {
$(".name img").css("display", "none");
$(".cont-wrap img").css("display", "none");
$(".short-about").css("background-image", "url(img/short-bg.png)");
}
}
resizeScreen();
$(window).on('resize', function() {
resizeScreen();
resizeScreenback();
});
$("a").on('click', function(e) {
e.preventDefault();
if ($(this).attr("href") == '#enroll') {
$("html, body").animate({
scrollTop: $($(this).attr("href")).offset().top + "px"
}, {
duration: 800,
easing: "swing"
});
}
return false;
});
$(".address a").on('click', function(e) {
if ($(this).attr("href") == '#enroll') {
$("html, body").animate({
scrollTop: $($(this).attr("href")).offset().top + "px"
}, {
duration: 800,
easing: "swing",
complete: function () {
var selectedCity = $('.my-tabs li.active').text();
if(selectedCity == 'Запорожье')
$('#city').val(1);
else
$('#city').val(2);
}
});
}
return false;
});
$('.choose-content #1').show();
$('.choose-content #2').hide();
$('.choose-content #3').hide();
$('#choose').on('change', function() {
if($('#choose').val() == 1) {
$('.choose-content #1').show();
$('.choose-content #2').hide();
$('.choose-content #3').hide();
}
else if ($('#choose').val() == 2) {
$('.choose-content #1').hide();
$('.choose-content #2').show();
$('.choose-content #3').hide();
}
else if ($('#choose').val() == 3) {
$('.choose-content #1').hide();
$('.choose-content #2').hide();
$('.choose-content #3').show();
}
});
$(".tab-content, .tab-content-child").hide();
$("ul.my-tabs li:first").addClass("active").show();
$(".tab-content:first").show();
$("ul.my-tabs li").click(function() {
$("ul.my-tabs li").removeClass("active");
$(this).addClass("active");
$(".tab-content").hide();
var activeTab = $(this).find("a").attr("href");
$(activeTab).fadeIn();
return false;
});
$(".tab-content-child:first").show();
$("ul.tabs-child li:first").addClass("active");
$("ul.tabs-child li").click(function() {
$("ul.tabs-child li").removeClass("active");
$(this).addClass("active");
$(".tab-content-child").hide();
var activeTab = $(this).find("a").attr("href");
$(activeTab).fadeIn();
return false;
});
var overlay = $('#modal-overlay');
var open_modal = $('.open-modal');
var close = $('.modal-close, #modal-overlay');
var modal = $('.modal');
open_modal.click( function(event){
event.preventDefault();
var div = $(this).attr('href');
overlay.fadeIn(400,
function(){
$(div)
.css('display', 'block')
.animate({opacity: 1, top: '50%'}, 200);
});
});
close.click( function(){
modal
.animate({opacity: 0, top: '45%'}, 200,
function(){
$(this).css('display', 'none');
overlay.fadeOut(400);
}
);
});
});