//Modernizr.load({
// test: Modernizr.csstransforms3d && Modernizr.csstransitions,
// yep: ['https://www.deshbandhu.co.in/js/jquery-3.2.1.min.js', 'https://www.deshbandhu.co.in/js/jquery.hoverfold.js'],
// nope: '../css/fallback.css',
// callback: function (url, result, key) {
// if (url === 'https://www.deshbandhu.co.in/js/jquery.hoverfold.js') {
// $('#grid').hoverfold();
//}
// }
//});
$(document).ready(function () {
$('.itemslider').carousel({ interval: 3000 });
$('.carousel-showmanymoveone .item').each(function () {
var itemToClone = $(this);
for (var i = 1; i < 1; i++) {
itemToClone = itemToClone.next();
if (!itemToClone.length) {
itemToClone = $(this).siblings(':first');
}
itemToClone.children(':first-child').clone()
.addClass("cloneditem-" + (i))
.appendTo($(this));
}
});
$("#back-top").hide();
$(function () {
$(window).scroll(function () {
if ($(this).scrollTop() > 100) {
$('#back-to-top').fadeIn();
} else {
$('#back-to-top').fadeOut();
}
});
$('#back-to-top span').click(function () {
$('body,html').animate({
scrollTop: 0
}, 800);
return false;
});
});
//===================================
loadGallery(true, 'a.thumbnail');
function disableButtons(counter_max, counter_current) {
$('#show-previous-image, #show-next-image').show();
if (counter_max == counter_current) {
$('#show-next-image').hide();
} else if (counter_current == 1) {
$('#show-previous-image').hide();
}
}
function loadGallery(setIDs, setClickAttr) {
var current_image,
selector,
counter = 0;
$('#show-next-image, #show-previous-image').click(function () {
if ($(this).attr('id') == 'show-previous-image') {
current_image--;
} else {
current_image++;
}
selector = $('[data-image-id="' + current_image + '"]');
updateGallery(selector);
});
function updateGallery(selector) {
var $sel = selector;
current_image = $sel.data('image-id');
$('#image-gallery-caption').text($sel.data('caption'));
$('#image-gallery-title').text($sel.data('title'));
$('#image-gallery-image').attr('src', $sel.data('image'));
disableButtons(counter, $sel.data('image-id'));
}
if (setIDs == true) {
$('[data-image-id]').each(function () {
counter++;
$(this).attr('data-image-id', counter);
});
}
$(setClickAttr).on('click', function () {
updateGallery($(this));
});
}
$('.flipButton').bind("click", function () {
$(this).next().toggleClass('hover');
});
$(".fiexed").click(function () {
$(".hideShow").toggle();
});
//======================================
});
(function ($) {
$(window).on("load", function () {
$(".content").mCustomScrollbar();
});
})(jQuery);
//$(function () {
// $('#sb-container').swatchbook({
// speed: 500,
// easing: 'ease-out',
// center: 7,
// angleInc: 14,
// proximity: 40,
// neighbor: 2
// });
//});
$('#ChangeToggle').click(function () {
if ($('#ChangeToggle span').hasClass('ToggleButton')) {
$('#ChangeToggle').html('Toggle navigation');
}
else {
$('#ChangeToggle').html('');
}
});
$(window).bind('scroll', function () {
if ($(window).scrollTop() > 200) {
$('.navbar-custome').addClass('scrolladd');
} else {
$('.navbar-custome').removeClass('scrolladd');
}
});
$(window).bind('scroll', function () {
if ($(window).scrollTop() > 200) {
$('.top-nav').addClass('marqueefix');
} else {
$('.top-nav').removeClass('marqueefix');
}
});
$(function () {
$('marquee').mouseover(function () {
$(this).attr('scrollamount', 0);
}).mouseout(function () {
$(this).attr('scrollamount', 5);
});
});
$(function () {
var btn = $(".slider__btn");
btn.on("click", function () {
$(".slider__item").first().clone().appendTo(".slider");
$(".slider__image").first().css({transform: "rotateX(-180deg)", opacity: 0 });
setTimeout(function () {
$(".slider__item").first().remove();
}, 200);
});
});
var mainImage = $("#mainImage");
$(".img-container img").hover(function () {
var src = $(this).attr("src");
$("#mainImage").attr("src", src);
});
mainImage.on("click", function () {
$(this).css("transform", "scale(2)");
});
$(function () {
$('.my-info').click(function () {
$(this).find('i').toggleClass('fa-angle-double-up fa-angle-double-down');
});
});
$(function () {
$('.fiexed').click(function () {
$(this).find('i').toggleClass('fa-chevron-down fa-chevron-up');
});
});
function Subscribe() {
var urlSubscription = "/WebService/DBNewsAPI.svc/SubcribeNewsLetter";
var userinput = $("#txtSubsription").val();
var pattern = /^([a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+(\.[a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)*|"((([ \t]*\r\n)?[ \t]+)?([\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*(([ \t]*\r\n)?[ \t]+)?")@(([a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.)+([a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.?$/i;
var IsValidEmail = pattern.test(userinput);
if (IsValidEmail) {
$.ajax({
url: urlSubscription,
type: 'GET',
data: { "emailID": userinput },
dataType: 'json',
crossDomain: true,
async: false,
success: function (data, textStatus, xhr) {
if (data.d != "") {
//var result = jQuery.parseJSON(data.d);
if (data.d == "-2") {
alert("You have already been subscribe for the NewsLetter");
return false;
}
else {
if (parseInt(data.d) > 0) {
alert("Congratulations! You have successfully subscribed the NewsLetter");
$("#txtSubsription").val("");
return false;
}
}
}
},
error: function (xhr, textStatus, errorThrown) {
console.log(errorThrown);
}
});
}
else {
alert('not a valid e-mail address');
return false;
}
}