(function ($) {
'use strict';
var browserWindow = $(window);
// :: 1.0 Preloader Active Code
// browserWindow.on('load', function () {
// $('.preloader').fadeOut('slow', function () {
// $(this).remove();
// });
// });
// :: 2.0 Nav Active Code
if ($.fn.classyNav) {
$('#oneMusicNav').classyNav();
}
// > Hover Tab function ========================== //
// function hover_tab(){
// alert('Ranjeet');
// $('.circle-block-outer[data-toggle="tab-hover"] div').on('mouseenter', function(){
// $(this).tab('show');
// });
// }
// :: 2.0 Search Toggle Code
/*$(".fa-search").click(function() {
$(".search-box").toggle();
$("input[type='text']").focus();
});*/
// Top Search
//$(".search-form").hide();
$(".search_icon").click(function(e) {
e.stopPropagation();
e.preventDefault();
$(this).toggleClass('current');
$(".search-box").toggleClass('visible');
});
$('.search-box').click(function(e) {
e.stopPropagation();
});
$('body').click(function() {
$(".search-box").removeClass('visible');
});
// Add popup
/* Add Feature Carousel only for Mobile */
$(document).ready(function() {
if ( $(window).width() < 854 ) {
startCarousel();
} else {
$('.owl-carousel').addClass('off');
}
});
$(window).resize(function() {
if ( $(window).width() < 854 ) {
startCarousel();
} else {
stopCarousel();
}
});
function startCarousel(){
$("#m-feature-slider").owlCarousel({
items:1,
loop:true,
pagination:true,
slideSpeed:5000,
singleItem:true,
autoPlay:true,
dots: true,
rewindNav:true,
rewindSpeed: 0,
});
}
function stopCarousel() {
var owl = $('.owl-carousel');
owl.trigger('destroy.owl.carousel');
owl.addClass('off');
}
// :: 3.0 Sliders Active Code
if ($.fn.owlCarousel) {
var welcomeSlide = $('.hero-slides');
var locationSlide = $('.location-slides');
var blogSlide = $('.blog-slides');
var testimonials = $('.testimonials-slide');
var albumSlides = $('.albums-slideshow');
var bankPartners = $('.bank-partners');
var featureSlide = $('.feature-slides');
welcomeSlide.owlCarousel({
items: 1,
margin: 0,
loop: true,
nav: false,
dots: true,
autoplay: true,
autoplayTimeout: 7000,
smartSpeed: 1000,
animateIn: 'fadeIn',
animateOut: 'fadeOut'
});
welcomeSlide.on('translate.owl.carousel', function () {
var slideLayer = $("[data-animation]");
slideLayer.each(function () {
var anim_name = $(this).data('animation');
$(this).removeClass('animated ' + anim_name).css('opacity', '0');
});
});
welcomeSlide.on('translated.owl.carousel', function () {
var slideLayer = welcomeSlide.find('.owl-item.active').find("[data-animation]");
slideLayer.each(function () {
var anim_name = $(this).data('animation');
$(this).addClass('animated ' + anim_name).css('opacity', '1');
});
});
$("[data-delay]").each(function () {
var anim_del = $(this).data('delay');
$(this).css('animation-delay', anim_del);
});
$("[data-duration]").each(function () {
var anim_dur = $(this).data('duration');
$(this).css('animation-duration', anim_dur);
});
locationSlide.owlCarousel({
items: 1,
margin: 0,
loop: true,
nav: true,
navText: [
'',
''
],
dots: true,
autoplay: true,
autoplayTimeout: 7000,
smartSpeed: 1000,
animateIn: 'fadeIn',
animateOut: 'fadeOut'
});
blogSlide.owlCarousel({
items: 1,
margin: 0,
loop: true,
nav: true,
navText: [
'',
''
],
dots: true,
autoplay: true,
autoplayTimeout: 7000,
smartSpeed: 1000,
animateIn: 'fadeIn',
animateOut: 'fadeOut'
});
featureSlide.owlCarousel({
items: 1,
margin: 0,
loop: true,
nav: true,
navText: [
'',
''
],
dots: true,
autoplay: true,
autoplayTimeout: 7000,
smartSpeed: 1000,
animateIn: 'fadeIn',
animateOut: 'fadeOut'
});
testimonials.owlCarousel({
items: 1,
margin: 0,
loop: true,
dots: false,
autoplay: true
});
bankPartners.owlCarousel({
items: 2,
margin: 10,
loop: true,
nav: true,
navText: ['', ''],
dots: false,
autoplay: true,
autoplayTimeout: 5000,
smartSpeed: 750,
responsive: {
0: {
items: 1
},
480: {
items: 2
},
768: {
items: 2
},
992: {
items: 2
},
1200: {
items: 2
}
}
});
}
/* slider-active */
$('.slider-full-active').owlCarousel({
loop:true,
margin:0,
items:1,
autoplay: true,
autoplayTimeout: 5000,
navText: ['', ''],
nav:true,
dots:true,
//interval:5000,
animateOut: 'slideOutUp',
animateIn: 'slideInUp',
responsive:{
0:{
items:1,
dots: false
},
767:{
items:1
},
992:{
items:1
}
}
})
var dot = $('.slider-full-active .owl-dot');
dot.each(function() {
var index = $(this).index() + 1;
if(index < 10){
$(this).html('0').append(index);
}else{
$(this).html(index);
}
});
/* Click on tab page scroll to top */
$('.nav-tabs a').click(function(e) {
$('html, body').stop();
e.preventDefault();
});
/* Floor Plan Carousel */
$("#floor-plan-slider, #floor-plan-slider-2bhk, #floor-plan-slider-3bhk").owlCarousel({
items: 1,
itemsDesktop: [1000, 1],
itemsDesktopSmall: [979, 1],
itemsTablet: [768, 1],
pagination: false,
nav: true,
navText: ['', ''],
//navigationText: ["", ""],
slideSpeed: 1500,
singleItem: true,
autoPlay: true,
rewindNav: true,
});
// magnify Popup full width
$('[data-magnify]').magnify({
resizable: false,
initMaximized: true
})
/*Add Read more and Less JS */
$("#toggle").click(function() {
var elem = $("#toggle").text();
if (elem == "Read More »") {
//Stuff to do when btn is in the read more state
$("#toggle").text("Read Less »");
$("#text").slideDown();
} else {
//Stuff to do when btn is in the read less state
$("#toggle").text("Read More »");
$("#text").slideUp();
}
});
/* Add Tabbed slider */
$(".rj-tab-container a").click(function(e) {
e.preventDefault();
$(".rj-tab-container").find('a').removeClass("active");
//console.log($(this).);
$(this).addClass("active");
var href = $(this).attr('href');
var tab_id = href.substring(1, href.length);
$(".rj-tab-content").removeClass("active");
$(".rj-tab-content#" + tab_id).addClass("active");
});
// Add 2nd nav-tabs
// :: 4.0 Masonary Gallery Active Code
if ($.fn.imagesLoaded) {
$('.oneMusic-albums').imagesLoaded(function () {
// filter items on button click
$('.catagory-menu').on('click', 'a', function () {
var filterValue = $(this).attr('data-filter');
$grid.isotope({
filter: filterValue
});
});
// init Isotope
var $grid = $('.oneMusic-albums').isotope({
itemSelector: '.single-album-item',
percentPosition: true,
masonry: {
columnWidth: '.single-album-item'
}
});
});
}
// :: 5.0 Video Active Code
if ($.fn.magnificPopup) {
$('.video--play--btn').magnificPopup({
disableOn: 0,
type: 'iframe',
mainClass: 'mfp-fade',
removalDelay: 160,
preloader: true,
fixedContentPos: false
});
}
/*Add Simple Lightbox*/
$('.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: 'The image #%curr% could not be loaded.',
titleSrc: function(item) {
return item.el.attr('title');
}
}
});
// :: 6.0 ScrollUp Active Code
if ($.fn.scrollUp) {
browserWindow.scrollUp({
scrollSpeed: 1500,
scrollText: ''
});
}
// :: 7.0 CounterUp Active Code
if ($.fn.counterUp) {
$('.counter').counterUp({
delay: 10,
time: 2000
});
}
// :: 8.0 Sticky Active Code
if ($.fn.sticky) {
$(".oneMusic-main-menu").sticky({
topSpacing: 0
});
}
// :: 9.0 Progress Bar Active Code
if ($.fn.circleProgress) {
$('#circle').circleProgress({
size: 160,
emptyFill: "rgba(0, 0, 0, .0)",
fill: '#000000',
thickness: '3',
reverse: true
});
$('#circle2').circleProgress({
size: 160,
emptyFill: "rgba(0, 0, 0, .0)",
fill: '#000000',
thickness: '3',
reverse: true
});
$('#circle3').circleProgress({
size: 160,
emptyFill: "rgba(0, 0, 0, .0)",
fill: '#000000',
thickness: '3',
reverse: true
});
$('#circle4').circleProgress({
size: 160,
emptyFill: "rgba(0, 0, 0, .0)",
fill: '#000000',
thickness: '3',
reverse: true
});
}
// :: 10.0 audioPlayer Active Code
if ($.fn.audioPlayer) {
$('audio').audioPlayer();
}
/*Sidebar fixed form */
$(document).scroll(function() {
var y = $(this).scrollTop();
if (y > 0) {
$('#feedback').fadeIn();
} else {
$('#feedback').fadeOut();
}
});
$(function() {
$("#feedback-tab").click(function() {
$("#feedback-form").toggle("slide");
$("#feedback-tab").toggleClass("enqury_btn");
//$('.icon-close').toggle("slide");
});
});
// :: 11.0 Tooltip Active Code
if ($.fn.tooltip) {
$('[data-toggle="tooltip"]').tooltip()
}
// :: 12.0 prevent default a click
$('a[href="#"]').on('click', function ($) {
$.preventDefault();
});
// :: 13.0 wow Active Code
if (browserWindow.width() > 767) {
new WOW().init();
}
// :: 14.0 Gallery Menu Active Code
$('.catagory-menu a').on('click', function () {
$('.catagory-menu a').removeClass('active');
$(this).addClass('active');
})
})(jQuery);