Advertisement
aivavic

script.js

Oct 25th, 2015
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function include(url){
  2.   document.write('<script src="'+url+'"></script>');
  3.   return false ;
  4. }
  5.  
  6. /* cookie.JS
  7. ========================================================*/
  8. include('js/jquery.cookie.js');
  9.  
  10.  
  11. /* DEVICE.JS
  12. ========================================================*/
  13. include('js/device.min.js');
  14.  
  15. /* Stick up menu
  16. ========================================================*/
  17. include('js/tmstickup.js');
  18. $(window).load(function() {
  19.   if ($('html').hasClass('desktop')) {
  20.       $('#stuck_container').TMStickUp({
  21.       })
  22.   }  
  23. });
  24.  
  25. /* Easing library
  26. ========================================================*/
  27. include('js/jquery.easing.1.3.js');
  28.  
  29.  
  30. /* ToTop
  31. ========================================================*/
  32. include('js/jquery.ui.totop.js');
  33. $(function () {  
  34.   $().UItoTop({ easingType: 'easeOutQuart' });
  35. });
  36.  
  37.  
  38.  
  39. /* DEVICE.JS AND SMOOTH SCROLLIG
  40. ========================================================*/
  41. include('js/jquery.mousewheel.min.js');
  42. include('js/jquery.simplr.smoothscroll.min.js');
  43.  
  44. $(function () {
  45.   if ($('html').hasClass('desktop')) {
  46.       $.srSmoothscroll({
  47.         step:150,
  48.         speed:800
  49.       });
  50.   }  
  51. });
  52.  
  53. /* Stellar.js
  54. ========================================================*/
  55. include('js/stellar/jquery.stellar.js');
  56. $(document).ready(function() {
  57.   if ($('html').hasClass('desktop')) {
  58.       $.stellar({
  59.         horizontalScrolling: false,
  60.         verticalOffset: 20
  61.       });
  62.      
  63.  
  64.   }  
  65. });
  66.  
  67. /* Copyright Year
  68. ========================================================*/
  69. var currentYear = (new Date).getFullYear();
  70. $(document).ready(function() {
  71.   $("#copyright-year").text( (new Date).getFullYear() );
  72. });
  73.  
  74.  
  75. /* Superfish menu
  76. ========================================================*/
  77. include('js/superfish.js');
  78. include('js/jquery.mobilemenu.js');
  79.  
  80.  
  81. /* Orientation tablet fix
  82. ========================================================*/
  83. $(function(){
  84. // IPad/IPhone
  85.     var viewportmeta = document.querySelector && document.querySelector('meta[name="viewport"]'),
  86.     ua = navigator.userAgent,
  87.  
  88.     gestureStart = function () {viewportmeta.content = "width=device-width, minimum-scale=0.25, maximum-scale=1.6, initial-scale=1.0";},
  89.  
  90.     scaleFix = function () {
  91.         if (viewportmeta && /iPhone|iPad/.test(ua) && !/Opera Mini/.test(ua)) {
  92.             viewportmeta.content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
  93.             document.addEventListener("gesturestart", gestureStart, false);
  94.         }
  95.     };
  96.    
  97.     scaleFix();
  98.     // Menu Android
  99.     if(window.orientation!=undefined){
  100.   var regM = /ipod|ipad|iphone/gi,
  101.    result = ua.match(regM)
  102.   if(!result) {
  103.    $('.sf-menu li').each(function(){
  104.     if($(">ul", this)[0]){
  105.      $(">a", this).toggle(
  106.       function(){
  107.        return false;
  108.       },
  109.       function(){
  110.        window.location.href = $(this).attr("href");
  111.       }
  112.      );
  113.     }
  114.    })
  115.   }
  116.  }
  117. });
  118. var ua=navigator.userAgent.toLocaleLowerCase(),
  119.  regV = /ipod|ipad|iphone/gi,
  120.  result = ua.match(regV),
  121.  userScale="";
  122. if(!result){
  123.  userScale=",user-scalable=0"
  124. }
  125. document.write('<meta name="viewport" content="width=device-width,initial-scale=1.0'+userScale+'">');
  126. /* Camera
  127.  ========================================================*/
  128. $(document).ready(function () {
  129.     var camera = $('#camera_wrap_1');
  130.     if(camera.length > 0 ){
  131.         camera.camera({
  132.  
  133.             minHeight: '392px',
  134.             height: '48%',
  135.             loader: 'none',
  136.             pagination: true,
  137.             thumbnails: false,
  138.             overlayer: true,
  139.             fx: 'simpleFade',
  140.             playPause: false,
  141.             navigation: false
  142.         });
  143.     }
  144. });
  145. /* Parallax
  146.  ========================================================*/
  147.  
  148. (function ($) {
  149.     var o = $('.parallax');
  150.     if (o.length > 0 && $('html').hasClass('desktop')) {
  151.         include('js/jquery.rd-parallax.js');
  152.     }
  153. })(jQuery);
  154. /* Carousel
  155.  ========================================================*/
  156. $(document).ready(function(){
  157.     var carousel = $('.owl-carousel');
  158.     if(carousel.length > 0 ) {
  159.         carousel.owlCarousel({
  160.             loop:true,
  161.             margin:10000,
  162.             autoWidth: false,
  163.             stagePadding: 10,
  164.             items: 1,
  165.             center: true,
  166.             nav: true,
  167.             navText: [ '&#xf053', '&#xf054' ],
  168.             navClass: [ 'owl-prev', 'owl-next' ]
  169.  
  170.         });
  171.     }
  172. });
  173. /* Google Map
  174.  ========================================================*/
  175. ;
  176. (function ($) {
  177.     var o = document.getElementById("google-map");
  178.     if (o) {
  179.         include('//maps.googleapis.com/maps/api/js?v=3.exp&amp;sensor=false');
  180.  
  181.         $(document).ready(function () {
  182.             var mapOptions = {
  183.                 zoom: 14,
  184.                 center: new google.maps.LatLng(parseFloat(40.646197), parseFloat(-73.9724068, 14)),
  185.                 scrollwheel: false
  186.             }
  187.             new google.maps.Map(o, mapOptions);
  188.         });
  189.     }
  190. })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement