$('#gallery-1').royalslider({ fullscreen: { enabled: true, nativefs: true }, controlnavigation: 'bullets', autoscaleslider: true, autoscalesliderwidth: 1920, autoscalesliderheight: 803, loop: true, imagescalemode: 'fill', navigatebyclick: true, numimagestopreload:2, arrowsnav:true, arrowsnavautohide: false, arrowsnavhideontouch: true, keyboardnavenabled: true, fadeinloadedslide: true, globalcaption: false, globalcaptioninside: false, thumbs: { appendspan: true, firstmargin: true, paddingbottom: 0 } }); // mobile nav =======================================start $('.mio-snavbar ul li a.mio-a').click(function(){ $(this).children('i').removeclass('icon-angle-right'); $(this).children('i').addclass('icon-angle-down'); $(this).next('.row').slidedown(); $(this).parent('li').siblings().children('.row').slideup(); }); $('.mio-navm').click(function(){ $('.mio-snavbar').fadein(100); $('.mio-navm i').fadeout(100); }); $('.mio-snavbar span').click(function(){ $('.mio-snavbar').fadeout(100); $('.mio-navm i').fadein(100); }); // nav $(function(){ $wh = $(window).width(); if($wh>640){ $('.mio-header ul.mio-nav>li').hover(function(){ $(this).addclass('st'); $(this).children('.mio-ns').slidedown(100); },function(){ $(this).removeclass('st'); $(this).children('.mio-ns').slideup(100); }); } }); //chat $(function () { $('a#mio-wx').hide(); $('a#mio-back-top').hide(); $(window).scroll(function(){ if ($(this).scrolltop() > 400) { $('.mio-a-top').show(); } else { $('.mio-a-top').hide(); } }); $('.mio-a-top').on('click', function(e){ e.preventdefault(); $('html, body').animate({scrolltop : 0},1000); return false; }); $('#mio-close').click(function(){ $('.mio-chat').fadeout(100); $('a#mio-wx').fadein(100); }); $('a#mio-wx').click(function(){ $('.mio-chat').fadein(100); $('a#mio-wx').fadeout(100); }); }); function shownav() { var stop = $(window).scrolltop(), sheight = 200; if (stop > sheight) { $('#mio-header').addclass('mio-navbar-top'); } else { $('#mio-header').removeclass('mio-navbar-top'); } } $(function(){ $(window).scroll(function () { shownav(); }); }); $(function(){ $('.mio-pmenu span').click(function(){ $(this).addclass('mio-st'); $(this).siblings().removeclass('mio-st'); $index = $(this).index(); $('.mio-pcontent .mio-pa:eq('+$index+')').show(); $('.mio-pcontent .mio-pa:eq('+$index+')').siblings().hide(); }); }); jquery.fn.limit=function(){ var self = $("div[limit]"); self.each(function(){ var objstring = $(this).text(); var objlength = $(this).text().length; var num = $(this).attr("limit"); if(objlength > num){ $(this).attr("title",objstring); objstring = $(this).text(objstring.substring(0,num) + "..."); } }) } $(function(){ $wh=$(window).width(); if($wh<640){ $(document.body).limit(); } })