1/* 2 Author: nicdark 3 Author URI: http://www.nicdarkthemes.com/ 4*/ 5 6 7(function($) { 8 "use strict"; 9 10 11 12 //isotope 13 $( window ).load(function() { 14 15 //create btns filter 16 $('.nicdark_masonry_btns div a').click( function() { 17 var filterValue = $( this ).attr('data-filter'); 18 $container_filter.isotope({ filter: filterValue }); 19 }); 20 21 //create masonry 22 var $container_masonry = $('.nicdark_masonry_container').isotope({ 23 itemSelector: '.nicdark_masonry_item' 24 }); 25 var $container_filter = $('.nicdark_masonry_container.nicdark_filter').isotope({}); 26 27 $( '.nicdark_simulate_click' ).trigger( "click" ); 28 29 }); 30 /////////// 31 32 33 //sidebar fixed 34 $( window ).load(function() { 35 36 var window_Width = $(window).width(); 37 var window_Height = $(window).height(); 38 var nicdark_sidebar_fixed_height = $('.nicdark_sidebar_fixed').height(); 39 40 41 //chaeck if element exists 42 if ( nicdark_sidebar_fixed_height > 0 ){ 43 44 //condition 45 if (window_Width < 1199 || window_Height < nicdark_sidebar_fixed_height+90 ){}else{ 46 47 $(window).scroll(function () { 48 49 //do 50 var nicdark_sidebar_fixed_container = $('.nicdark_sidebar_fixed_container').offset().top; 51 var nicdark_scroll = $(this).scrollTop(); 52 var nicdark_sidebar_fixed_width = $('.nicdark_sidebar_fixed').width() + 'px'; 53 54 //get height 55 var nicdark_sidebar_fixed_container_height = $('.nicdark_sidebar_fixed_container').height() - 20; 56 var nicdark_difference_height = nicdark_sidebar_fixed_container_height - nicdark_sidebar_fixed_height - 90; 57 var nicdark_sidebar_fixed_margin_top = nicdark_sidebar_fixed_container_height - nicdark_sidebar_fixed_height; 58 59 60 if (nicdark_scroll > nicdark_sidebar_fixed_container-90 && nicdark_scroll < nicdark_sidebar_fixed_container+nicdark_difference_height) { 61 62 $('.nicdark_sidebar_fixed').css({ 63 'position': 'fixed', 64 'top': '90px', 65 'margin-top': '0px', 66 'width': nicdark_sidebar_fixed_width 67 }); 68 69 70 }else if ( nicdark_scroll >= nicdark_sidebar_fixed_container+nicdark_difference_height) { 71 72 $('.nicdark_sidebar_fixed').css({ 73 'position': 'static', 74 'margin-top': nicdark_sidebar_fixed_margin_top 75 }); 76 77 } else { 78 79 $('.nicdark_sidebar_fixed').css({ 80 'position': 'static', 81 'margin-top': '0px' 82 }); 83 84 } 85 //end do 86 87 }); 88 89 } 90 //end condition 91 92 } 93 94 }); 95 //sidebar fixed 96 97 98 99 100 101 //inview 102 var windowWidth = $(window).width(); 103 104 if (windowWidth < 400){ 105 106 $('.fade-left, .fade-up, .fade-down, .fade-right, .bounce-in, .rotate-In-Down-Left, .rotate-In-Down-Right').css('opacity','1'); 107 108 }else{ 109 110 $('.fade-up').bind('inview', function(event, visible) { if (visible == true) { $(this).addClass('animated fadeInUp'); } }); 111 $('.fade-down').bind('inview', function(event, visible) { if (visible == true) { $(this).addClass('animated fadeInDown'); } }); 112 $('.fade-left').bind('inview', function(event, visible) { if (visible == true) { $(this).addClass('animated fadeInLeft'); } }); 113 $('.fade-right').bind('inview', function(event, visible) { if (visible == true) { $(this).addClass('animated fadeInRight'); } }); 114 $('.bounce-in').bind('inview', function(event, visible) { if (visible == true) { $(this).addClass('animated bounceIn'); } }); 115 $('.rotate-In-Down-Left').bind('inview', function(event, visible) { if (visible == true) { $(this).addClass('animated rotateInDownLeft'); } }); 116 $('.rotate-In-Down-Right').bind('inview', function(event, visible) { if (visible == true) { $(this).addClass('animated rotateInDownRight'); } }); 117 118 } 119 /////////// 120 121 122 123 //menu 124 $('.nicdark_navigation .menu').superfish({}); 125 //megamenu 126 $('.nicdark_megamenu ul a').removeClass('sf-with-ul'); 127 $($('.nicdark_megamenu ul li').find('ul').get().reverse()).each(function(){ 128 $(this).replaceWith($('<ol>'+$(this).html()+'</ol>')) 129 }) 130 //responsive 131 $('.nicdark_navigation .menu').tinyNav({ 132 active: 'selected', 133 header: 'MENU' 134 }); 135 /////////// 136 137 138 139 //fixed menu 140 jQuery(window).scroll(function(){ 141 add_class_scroll(); 142 }); 143 add_class_scroll(); 144 function add_class_scroll() { 145 if(jQuery(window).scrollTop() > 100) { 146 jQuery('.nicdark_navigation').addClass('slowup'); 147 jQuery('.nicdark_navigation').removeClass('slowdown'); 148 } else { 149 jQuery('.nicdark_navigation').addClass('slowdown'); 150 jQuery('.nicdark_navigation').removeClass('slowup'); 151 } 152 } 153 /////////// 154 155 156 157 //tooltip 158 $( '.nicdark_tooltip' ).tooltip({ 159 position: { 160 my: "center top", 161 at: "center+0 top-50" 162 } 163 });
164 //basic calendar 165 $( '.nicdark_calendar' ).datepicker({ }); 166 167 168 //calendar from and to 169 $( ".nicdark_calendar_range.nicdark_calendar_from" ).datepicker({ 170 changeMonth: false, 171 numberOfMonths: 1, 172 onClose: function( selectedDate ) { 173 $( ".nicdark_calendar_to" ).datepicker( "option", "minDate", selectedDate ); 174 } 175 }); 176 $( ".nicdark_calendar_range.nicdark_calendar_to" ).datepicker({ 177 changeMonth: false, 178 numberOfMonths: 1, 179 onClose: function( selectedDate ) { 180 $( ".nicdark_calendar_from" ).datepicker( "option", "maxDate", selectedDate ); 181 } 182 }); 183 184 185 186 187 //slider-range 188 $( ".nicdark_slider_range" ).slider({ 189 range: true, 190 min: 0, 191 max: 10000, 192 values: [ 1000, 9000 ], 193 slide: function( event, ui ) { 194 $( ".nicdark_slider_amount" ).val( "$ " + ui.values[ 0 ] + " - $ " + ui.values[ 1 ] ); 195 } 196 }); 197 $( ".nicdark_slider_amount" ).val( "$ " + $( ".nicdark_slider_range" ).slider( "values", 0 ) + " - $ " + $( ".nicdark_slider_range" ).slider( "values", 1 ) ); 198 199 200 //alerts 201 $('.nicdark_alerts').click(function(event){ 202 $(this).css({ 203 'display': 'none', 204 }); 205 }); 206 /////////// 207 208 209 //internal-link 210 $('.nicdark_internal_link').click(function(event){ 211 212 event.preventDefault(); 213 var full_url = this.href; 214 var parts = full_url.split("#"); 215 var trgt = parts[1]; 216 var target_offset = $("#"+trgt).offset(); 217 var target_top = target_offset.top; 218 219 $('html,body').animate({scrollTop:target_top -13}, 900); 220 221 }); 222 /////////// 223 224 225 226 //counter 227 $('.nicdark_counter').data('countToOptions', { 228 formatter: function (value, options) { 229 return value.toFixed(options.decimals).replace(/\B(?=(?:\d{3})+(?!\d))/g, ','); 230 } 231 }); 232 // start all the timers 233 $('.nicdark_counter').bind('inview', function(event, visible) { 234 if (visible == true) { 235 $('.nicdark_counter').each(count); 236 } 237 }); 238 function count(options) { 239 var $this = $(this); 240 options = $.extend({}, options || {}, $this.data('countToOptions') || {}); 241 $this.countTo(options); 242 } 243 /////////// 244 245 246 //nicescrool 247 $(".nicdark_nicescrool").niceScroll({ 248 touchbehavior:false, 249 cursoropacitymax:1, 250 cursorwidth:0, 251 autohidemode:false, 252 cursorborder:0 253 }); 254 /////////// 255 256 257 258 //left sidebar OPEN 259 $('.nicdark_left_sidebar_btn_open').click(function(event){ 260 $('.nicdark_left_sidebar').css({ 261 'left': '0px', 262 }); 263 $('.nicdark_site, .nicdark_navigation').css({ 264 'margin-left': '300px', 265 }); 266 $('.nicdark_overlay').addClass('nicdark_overlay_on'); 267 }); 268 //left sidebar CLOSE 269 $('.nicdark_left_sidebar_btn_close, .nicdark_overlay').click(function(event){ 270 $('.nicdark_left_sidebar').css({ 271 'left': '-300px' 272 }); 273 $('.nicdark_site, .nicdark_navigation').css({ 274 'margin-left': '0px' 275 }); 276 $('.nicdark_overlay').removeClass('nicdark_overlay_on'); 277 }); 278 //right sidebar OPEN 279 $('.nicdark_right_sidebar_btn_open').click(function(event){ 280 $('.nicdark_right_sidebar').css({ 281 'right': '0px', 282 }); 283 $('.nicdark_site, .nicdark_navigation').css({ 284 'margin-left': '-300px', 285 }); 286 $('.nicdark_overlay').addClass('nicdark_overlay_on'); 287 }); 288 //right sidebar CLOSE 289 $('.nicdark_right_sidebar_btn_close, .nicdark_overlay').click(function(event){ 290 $('.nicdark_right_sidebar').css({ 291 'right': '-300px' 292 }); 293 $('.nicdark_site, .nicdark_navigation').css({ 294 'margin-left': '0px' 295 }); 296 $('.nicdark_overlay').removeClass('nicdark_overlay_on'); 297 }); 298 /////////// 299 300 301 302 //nicdark_mpopup_gallery 303 $('.nicdark_mpopup_gallery').magnificPopup({ 304 delegate: 'a', 305 type: 'image', 306 tLoading: 'Loading image #%curr%...', 307 mainClass: 'mfp-fade', 308 gallery: { 309 enabled: true, 310 navigateByImgClick: true, 311 preload: [0,1] // Will preload 0 - before current, and 1 after the current image 312 }, 313 image: { 314 tError: '<a href="%url%">The image #%curr%</a> could not be loaded.', 315 titleSrc: function(item) { 316 return item.el.attr('title'); 317 } 318 } 319 }); 320 //nicdark_mpopup_iframe 321 $('.nicdark_mpopup_iframe').magnificPopup({ 322 disableOn: 200, 323 type: 'iframe', 324 mainClass: 'mfp-fade', 325 removalDelay: 160, 326 preloader: false, 327
328 fixedContentPos: false 329 }); 330 //nicdark_mpopup_window 331 $('.nicdark_mpopup_window').magnificPopup({ 332 type: 'inline', 333 334 fixedContentPos: false, 335 fixedBgPos: true, 336 337 overflowY: 'auto', 338 339 closeBtnInside: true, 340 preloader: false, 341 342 midClick: true, 343 removalDelay: 300, 344 mainClass: 'my-mfp-zoom-in' 345 }); 346 //nicdark_mpopup_ajax 347 $('.nicdark_mpopup_ajax').magnificPopup({ 348 type: 'ajax', 349 alignTop: false, 350 overflowY: 'scroll' 351 }); 352 ////////// 353 354 355 356 //pagination 357 $('.nicdark_pagination .nicdark_btn').on('click',function(){ 358 $('.nicdark_pagination .nicdark_btn').removeClass('active'); 359 $(this).addClass('active'); 360 }); 361 //end pagination 362 363 364})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.