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