/* * template name: unify - responsive bootstrap template * description: business, corporate, portfolio and blog theme. * version: 1.4 * author: @htmlstream * website: http://htmlstream.com */ var app = function () { function handleiefixes() { //fix html5 placeholder attribute for ie7 & ie8 if (jquery.browser.msie && jquery.browser.version.substr(0, 1) < 9) { // ie7&ie8 jquery('input[placeholder], textarea[placeholder]').each(function () { var input = jquery(this); jquery(input).val(input.attr('placeholder')); jquery(input).focus(function () { if (input.val() == input.attr('placeholder')) { input.val(''); } }); jquery(input).blur(function () { if (input.val() == '' || input.val() == input.attr('placeholder')) { input.val(input.attr('placeholder')); } }); }); } } function handlebootstrap() { /*bootstrap carousel*/ jquery('.carousel').carousel({ interval: 15000, pause: 'hover' }); /*tooltips*/ jquery('.tooltips').tooltip(); jquery('.tooltips-show').tooltip('show'); jquery('.tooltips-hide').tooltip('hide'); jquery('.tooltips-toggle').tooltip('toggle'); jquery('.tooltips-destroy').tooltip('destroy'); /*popovers*/ jquery('.popovers').popover(); jquery('.popovers-show').popover('show'); jquery('.popovers-hide').popover('hide'); jquery('.popovers-toggle').popover('toggle'); jquery('.popovers-destroy').popover('destroy'); } function handlesearch() { jquery('.search').click(function () { if(jquery('.search-btn').hasclass('fa-search')){ jquery('.search-open').fadein(500); jquery('.search-btn').removeclass('fa-search'); jquery('.search-btn').addclass('fa-times'); } else { jquery('.search-open').fadeout(500); jquery('.search-btn').addclass('fa-search'); jquery('.search-btn').removeclass('fa-times'); } }); } function handletoggle() { jquery('.list-toggle').on('click', function() { jquery(this).toggleclass('active'); }); /* jquery('#servicelist').on('shown.bs.collapse'), function() { jquery(".servicedrop").addclass('glyphicon-chevron-up').removeclass('glyphicon-chevron-down'); } jquery('#servicelist').on('hidden.bs.collapse'), function() { jquery(".servicedrop").addclass('glyphicon-chevron-down').removeclass('glyphicon-chevron-up'); } */ } function handleswitcher() { var panel = jquery('.style-switcher'); jquery('.style-switcher-btn').click(function () { jquery('.style-switcher').show(); }); jquery('.theme-close').click(function () { jquery('.style-switcher').hide(); }); jquery('li', panel).click(function () { var color = jquery(this).attr("data-style"); var data_header = jquery(this).attr("data-header"); setcolor(color, data_header); jquery('.list-unstyled li', panel).removeclass("theme-active"); jquery(this).addclass("theme-active"); }); var setcolor = function (color, data_header) { jquery('#style_color').attr("href", "assets/css/themes/" + color + ".css"); if(data_header == 'light'){ jquery('#style_color-header-1').attr("href", "assets/css/themes/headers/header1-" + color + ".css"); jquery('#logo-header').attr("src", "assets/img/logo1-" + color + ".png"); jquery('#logo-footer').attr("src", "assets/img/logo2-" + color + ".png"); } else if(data_header == 'dark'){ jquery('#style_color-header-2').attr("href", "assets/css/themes/headers/header2-" + color + ".css"); jquery('#logo-header').attr("src", "assets/img/logo1-" + color + ".png"); jquery('#logo-footer').attr("src", "assets/img/logo2-" + color + ".png"); } } } function handleboxed() { jquery('.boxed-layout-btn').click(function(){ jquery(this).addclass("active-switcher-btn"); jquery(".wide-layout-btn").removeclass("active-switcher-btn"); jquery("body").addclass("boxed-layout container"); }); jquery('.wide-layout-btn').click(function(){ jquery(this).addclass("active-switcher-btn"); jquery(".boxed-layout-btn").removeclass("active-switcher-btn"); jquery("body").removeclass("boxed-layout container"); }); } function handleheader() { jquery(window).scroll(function() { if (jquery(window).scrolltop()>100){ jquery(".header-fixed .header").addclass("header-fixed-shrink"); } else { jquery(".header-fixed .header").removeclass("header-fixed-shrink"); } }); } return { init: function () { handlebootstrap(); handleiefixes(); handlesearch(); handletoggle(); handleswitcher(); handleboxed(); handleheader(); }, initsliders: function () { jquery('#testimonal_carousel').collapse({ toggle: false }); }, initfancybox: function () { jquery(".fancybox-button").fancybox({ groupattr: 'data-rel', preveffect: 'none', nexteffect: 'none', closebtn: true, helpers: { title: { type: 'inside' } } }); jquery(".iframe").fancybox({ maxwidth : 800, maxheight : 600, fittoview : false, width : '70%', height : '70%', autosize : false, closeclick : false, openeffect : 'none', closeeffect : 'none' }); }, initbxslider: function () { jquery('.bxslider').bxslider({ maxslides: 4, minslides: 4, slidewidth: 360, slidemargin: 10, }); jquery('.bxslider1').bxslider({ minslides: 3, maxslides: 3, slidewidth: 360, slidemargin: 10 }); jquery('.bxslider2').bxslider({ minslides: 2, maxslides: 2, slidewidth: 360, slidemargin: 10 }); }, initcounter: function () { jquery('.counter').counterup({ delay: 10, time: 1000 }); }, initparallaxbg: function () { jquery('.parallaxbg').parallax("50%", 0.2); jquery('.parallaxbg1').parallax("50%", 0.4); }, }; }();