// javascript document $(function() { "use strict"; function responsive_dropdown () { /* ---- for mobile menu dropdown js start ---- */ $('#menu span.opener').on("click", function() { if ($(this).hasclass("plus")) { $(this).parent().find('.mobile-sub-menu').slidedown(); $(this).removeclass('plus'); $(this).addclass('minus'); } else { $(this).parent().find('.mobile-sub-menu').slideup(); $(this).removeclass('minus'); $(this).addclass('plus'); } return false; }); /* ---- for mobile menu dropdown js end ---- */ /*---mobile menu icon start---*/ var navbar_toggle = $('.navbar-toggle i'); var menu_var = $('#menu'); $('.navbar-toggle').on("click", function(){ if(menu_var.hasclass('menu-open')){ menu_var.removeclass('menu-open'); navbar_toggle.removeclass('fa-close'); navbar_toggle.addclass('fa-bars'); }else{ menu_var.addclass('menu-open'); navbar_toggle.addclass('fa-close'); navbar_toggle.removeclass('fa-bars'); } return false; }); /*---mobile menu icon end---*/ /* ---- for sidebar js start ---- */ $('.sidebar-box span.opener').on("click", function(){ if ($(this).hasclass("plus")) { $(this).parent().find('.sidebar-contant').slidedown(); $(this).removeclass('plus'); $(this).addclass('minus'); } else { $(this).parent().find('.sidebar-contant').slideup(); $(this).removeclass('minus'); $(this).addclass('plus'); } return false; }); /* ---- for sidebar js end ---- */ /* ---- for footer js start ---- */ $('.footer-static-block span.opener').on("click", function(){ if ($(this).hasclass("plus")) { $(this).parent().find('.footer-block-contant').slidedown(); $(this).removeclass('plus'); $(this).addclass('minus'); } else { $(this).parent().find('.footer-block-contant').slideup(); $(this).removeclass('minus'); $(this).addclass('plus'); } return false; }); /* ---- for footer js end ---- */ } function owlcarousel_slider () { /* ------------ owl slider start ------------- */ /* ----- #roll-img start ------ */ $('#roll-img').owlcarousel({ items: 4, navigation: true, pagination: false, itemsdesktop : [1199, 4], itemsdesktopsmall : [991, 3], itemstablet : [768, 2], itemstabletsmall : false, itemsmobile : [479, 1] }); /* ----- #roll-img end ------ */ /* ----- #roll-img2 start ------ */ $('#roll-img2').owlcarousel({ items: 4, navigation: true, pagination: false, itemsdesktop : [1199, 4], itemsdesktopsmall : [991, 3], itemstablet : [768, 2], itemstabletsmall : false, itemsmobile : [479, 1] }); /* ----- #roll-img2 end ------ */ /* ----- #roll-img2 start ------ */ $('#roll-img3').owlcarousel({ items: 5, navigation: true, pagination: false, itemsdesktop : [1199, 5], itemsdesktopsmall : [991, 4], itemstablet : [768, 3], itemstabletsmall : false, itemsmobile : [479, 2] }); /* ----- #roll-img2 end ------ */ /* ---- testimonial start ---- */ $("#client, .main-banner").owlcarousel({ /* navigation : true, show next and prev buttons*/ slidespeed : 300, paginationspeed : 400, autoplay: false, pagination:true, singleitem:true, navigation:true }); /* ----- testimonial end ------ */ /* ------------ owl slider end ------------- */ } function scrolltop_arrow () { /* ---- page scrollup js start ---- */ //when distance from top = 250px fade button in/out var scrollup = $('#scrollup'); var headertag = $('header'); var mainfix = $('.main'); $(window).scroll(function(){ if ($(this).scrolltop() > 250) { scrollup.fadein(300); } else { scrollup.fadeout(300); } /* header-fixed js start */ if ($(this).scrolltop() > 100){ headertag.addclass("header-fixed"); } else{ headertag.removeclass("header-fixed"); } /* main-fixed js start */ if ($(this).scrolltop() > 0){ mainfix.addclass("main-fixed"); } else{ mainfix.removeclass("main-fixed"); } /* ---- page scrollup js end ---- */ }); //on click scroll to top of page t = 1000ms scrollup.on("click", function(){ $("html, body").animate({ scrolltop: 0 }, 1000); return false; }); } function custom_tab() { /* ----------- product category tab start ------------ */ $('.tab-stap').on('click', 'li', function() { $('.tab-stap li').removeclass('active'); $(this).addclass('active'); $(".product-slider-main").fadeout(); var currentliid = $(this).attr('id'); $("#data-"+currentliid).fadein(); return false; }); /* ------------ product category tab end ------------ */ /* ------------ account tab js start ------------ */ $('.about-tab-stap').on('click', 'li', function() { $('.about-tab-stap li').removeclass('active'); $(this).addclass('active'); $(".about-content").fadeout(); var currentliid = $(this).attr('id'); $("#data-"+currentliid).fadein(); return false; }); /* ------------ account tab js end ------------ */ } /* price-range js start */ function price_range () { $( "#slider-range" ).slider({ range: true, min: 0, max: 800, values: [ 75, 500 ], slide: function( event, ui ) { $( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] ); } }); $( "#amount" ).val( "$" + $( "#slider-range" ).slider( "values", 0 ) + " - $" + $( "#slider-range" ).slider( "values", 1 ) ); } /* price-range js end */ /* product detail page tab js start */ function description_tab () { $("#tabs li a").on("click", function(e){ var title = $(e.currenttarget).attr("title"); $("#tabs li a").removeclass("selected") $(".tab_content li div").removeclass("selected") $(".tab-"+title).addclass("selected") $(".items-"+title).addclass("selected") $("#items").attr("class","tab-"+title); return false; }); } /* product detail page tab js end */ /*load-more js start*/ function load_more () { $(".best-pro-col").slice(0, 8).show(); $("#loadmore-best").on('click', function (e) { e.preventdefault(); $(".best-pro-col:hidden").slice(0, 4).slidedown(); if ($(".best-pro-col:hidden").length == 0) { $("#load").fadeout('slow'); } }); $(".new-pro-col").slice(0, 8).show(); $("#loadmore-new").on('click', function (e) { e.preventdefault(); $(".new-pro-col:hidden").slice(0, 4).slidedown(); if ($(".new-pro-col:hidden").length == 0) { $("#load").fadeout('slow'); } }); $(".special-pro-col").slice(0, 8).show(); $("#loadmore-special").on('click', function (e) { e.preventdefault(); $(".special-pro-col:hidden").slice(0, 4).slidedown(); if ($(".special-pro-col:hidden").length == 0) { $("#load").fadeout('slow'); } }); } /*load-more js ends*/ /*select menu js start*/ function option_drop() { $( "#country" ).selectmenu(); $( "#currency" ).selectmenu(); }; /*select menu js ends*/ $(document).ready(function() { owlcarousel_slider(); price_range (); responsive_dropdown(); description_tab (); custom_tab (); scrolltop_arrow (); load_more(); option_drop(); }); $( window ).on( "resize", function() { }); }); $( window ).on( "load", function() { // animate loader off screen $(".se-pre-con").fadeout("slow"); });