1jQuery( document ).ready( function($){ 2 "use strict"; 3 4 5 /**------------------------------------------------- 6 *Fixed Header 7 *----------------------------------------------------**/ 8 $(window).on('scroll', function () { 9 10 /**Fixed header**/ 11 if ($(window).scrollTop() > 250) { 12 $('.navbar-sticky').addClass('sticky fade_down_effect'); 13 } else { 14 $('.navbar-sticky').removeClass('sticky fade_down_effect'); 15 } 16}); 17 18 19 /* ----------------------------------------------------------- */ 20 /* Menu 21 /* ----------------------------------------------------------- */ 22 $('.dropdown > a').on('click', function(e) { 23 e.preventDefault(); 24 if($(window).width() > 991) 25 { 26 location.href = this.href; 27 } 28 var dropdown = $(this).parent('.dropdown'); 29 dropdown.find('>.dropdown-menu').slideToggle('show'); 30 $(this).toggleClass('opened'); 31 return false; 32 }); 33 34 $('.digiqole-elementskit-menu').each(function(){ 35 $(this).parents('.navbar').addClass('digiqole-elementskit-menu-container'); 36 }); 37 38 /*========================================================== 39 39. scroll bar 40 ======================================================================*/ 41 42 // if ($(".video-tab-scrollbar").length > 0) { 43 // $(".video-tab-scrollbar").mCustomScrollbar({ 44 // mouseWheel: true, 45 // scrollButtons: { 46 // enable: true 47 // } 48 // }); 49 // } 50 51 52 /* ----------------------------------------------------------- */ 53 /* tooltip 54 /* ----------------------------------------------------------- */ 55 $(document).ready(function () { 56 $('[data-toggle="tooltip"]').tooltip(); 57 }); 58 59 /*========================================================== 60 search popup 61 ======================================================================*/ 62 if ($('.xs-modal-popup').length > 0) { 63 $('.xs-modal-popup').magnificPopup({ 64 type: 'inline', 65 fixedContentPos: false, 66 fixedBgPos: true, 67 overflowY: 'auto', 68 closeBtnInside: false, 69 callbacks: { 70 beforeOpen: function beforeOpen() { 71 this.st.mainClass = "my-mfp-slide-bottom xs-promo-popup"; 72 } 73 } 74 }); 75 } 76 77 /* ----------------------------------------------------------- */ 78 /* Video popup 79 /* ----------------------------------------------------------- */ 80 81 if ($('.ts-play-btn').length > 0) { 82 $('.ts-play-btn').magnificPopup({ 83 type: 'iframe', 84 mainClass: 'mfp-with-zoom', 85 zoom: { 86 enabled: true, // By default it's false, so don't forget to enable it 87 88 duration: 300, // duration of the effect, in milliseconds 89 easing: 'ease-in-out', // CSS transition easing function 90 91 opener: function (openerElement) { 92 return openerElement.is('img') ? openerElement : openerElement.find('img'); 93 } 94 } 95 }); 96} 97 98 if ($('.play-btn').length > 0) { 99 $('.play-btn').magnificPopup({ 100 type: 'iframe', 101 mainClass: 'mfp-with-zoom', 102 zoom: { 103 enabled: true, // By default it's false, so don't forget to enable it 104 105 duration: 300, // duration of the effect, in milliseconds 106 easing: 'ease-in-out', // CSS transition easing function 107 108 opener: function (openerElement) { 109 return openerElement.is('img') ? openerElement : openerElement.find('img'); 110 } 111 } 112 }); 113} 114 115 116 /* ----------------------------------------------------------- */ 117 /* Back to top 118 /* ----------------------------------------------------------- */ 119 120 $(window).on('scroll', function () { 121 if ($(window).scrollTop() > $(window).height()) { 122 $(".BackTo").fadeIn('slow'); 123 } else { 124 $(".BackTo").fadeOut('slow'); 125 } 126 127 }); 128 $("body, html").on("click", ".BackTo", function (e) { 129 e.preventDefault(); 130 $('html, body').animate({ 131 scrollTop: 0 132 }, 800); 133 }); 134 135 $(".popular-grid-slider").owlCarousel( 136 { 137 items: 3, 138 dots: false, 139 loop: true, 140 nav: true, 141 margin: 30, 142 navText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"], 143 responsive: { 144 // breakpoint from 0 up 145 0: { 146 items: 1, 147 }, 148 // breakpoint from 480 up 149 480: { 150 items: 2, 151 }, 152 // breakpoint from 768 up 153 768: { 154 items: 2, 155 }, 156 // breakpoint from 768 up 157 1200: { 158 items: 3, 159 } 160 } 161 } 162 ); 163 164 $(".category-feature-slider").owlCarousel( 165 { 166 items: 1, 167 dots: false, 168 loop: false, 169 nav: true, 170 margin: 30, 171 navText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"], 172 } 173 ); 174 175 /*========================================================== 176 scroll bar 177 ======================================================================*/ 178 179 $('.video-tab-list .post-tab-list li').on('click',function(){ 180 $('.video-index').html($(this).data('index')); 181 }); 182 183 if ($(".video-tab-scrollbar").length > 0) { 184 185 $(".video-tab-scrollbar").mCustomScrollbar({ 186 mouseWheel: true, 187 scrollButtons: { 188 enable: true 189 } 190 }); 191 192 } 193 194 195 196 /*========================================================== 197 Post grid ajax load 198 ======================================================================*/ 199 200 $('.digiqole-post-grid-loadmore').on('click',function(event){ 201 event.preventDefault(); 202 203 var $that = $(this); 204 var ajaxjsondata = $that.data('json_grid_meta'); 205 var digiqole_json_data = Object (ajaxjsondata); 206 207 var contentwrap = $('.grid-loadmore-content'), // item contentwrap 208 postperpage = parseInt(digiqole_json_data.posts_per_page), // post per page number 209 showallposts = parseInt(digiqole_json_data.total_post); // total posts count 210 211 var items = contentwrap.find('.grid-item'), 212 totalpostnumber = parseInt(items.length), 213 paged = parseInt( totalpostnumber / postperpage ) + 1; // paged number 214 215 $.ajax({ 216 url: digiqole_ajax.ajax_url, 217 type: 'POST', 218 data: {action: 'digiqole_post_ajax_loading',ajax_json_data: ajaxjsondata,paged:paged}, 219 beforeSend: function(){ 220 221 $('<i class="fa fa-spinner fa-spin" style="margin-left:10px"></i>').appendTo( "#digiqole-post-grid-loadmore" ).fadeIn(100); 222 }, 223 complete:function(){ 224 $('.digiqole-post-grid-loadmore .fa-spinner ').remove(); 225 } 226 }) 227 228 .done(function(data) { 229 230 var $pstitems = $(data); 231 $('.grid-loadmore-content').append( $pstitems ); 232 var newLenght = contentwrap.find('.grid-item').length; 233 234 if(showallposts <= newLenght){ 235 $('.digiqole-post-grid-loadmore').fadeOut(300,function(){ 236 $('.digiqole-post-grid-loadmore').remove(); 237 }); 238 } 239 240 }) 241 242 .fail(function() { 243 $('.digiqole-post-grid-loadmore').remove(); 244 }); 245 246 }); 247 248 /*========================================================== 249 review rating circle 250 ======================================================================*/ 251 $(function() { 252 $('.review-chart').easyPieChart({ 253 scaleColor: "", 254 lineWidth: 5, 255 lineCap: 'butt', 256 barColor: '#1abc9c', 257 trackColor: "rgba(34,34,34, .4)", 258 size: 70, 259 animate: 70 260 }); 261 }); 262 263 /*========================================================== 264 reading progressbar 265 ======================================================================*/ 266 267 window.onscroll = function() { reading_progressbar() }; 268 269 function reading_progressbar() { 270 var digiqole_winScroll = document.body.scrollTop || document.documentElement.scrollTop; 271 var digiqole_height = document.documentElement.scrollHeight - document.documentElement.clientHeight; 272 var digiqole_scrolled = (digiqole_winScroll / digiqole_height) * 100; 273 if (document.getElementById("readingProgressbar")) { 274 document.getElementById("readingProgressbar").style.width = digiqole_scrolled + "%"; 275 } 276 } 277 278 reading_progress_bar_post(); 279 280 function reading_progress_bar_post() { 281 282 var progressWrap = $('.digiqole_progress_container'); 283 284 285 if ( progressWrap.length > 0 ) { 286 var didScroll = false, 287 windowWrap = $(window), 288 289 contentWrap = $('.entry-content'), 290 contentHeight = contentWrap.height(), 291 windowHeight = windowWrap.height() * .85; 292 293 $(window).scroll(function() { 294 didScroll = true; 295 }); 296 297 $(window).on('resize', function(){ 298 windowHeight = windowWrap.height() * .85; 299 progressReading(); 300 }); 301 302 setInterval(function() { 303 if ( didScroll ) { 304 didScroll = false;
305 progressReading(); 306 } 307 }, 150); 308 309 var progressReading = function() { 310 311 var windowScroll = windowWrap.scrollTop(), 312 contentOffset = contentWrap.offset().top, 313 contentScroll = ( windowHeight - contentOffset ) + windowScroll, 314 progress = 0; 315 316 if ( windowHeight > contentHeight + contentOffset ) { 317 progressWrap.find('.progress-bar').width(0); 318 } else { 319 if ( contentScroll > contentHeight ) { 320 progress = 100; 321 } else if ( contentScroll > 0 ) { 322 progress = ( contentScroll / contentHeight ) * 100 ; 323 324 } 325 326 progressWrap.find('.progress-bar').width(progress + '%'); 327 } 328 } 329 } 330 } 331 332 // Sticky sidebar 333 334 if(digiqole_ajax.blog_sticky_sidebar == 'yes' && $('#sidebar').length>0){ 335 336 var top = $('#sidebar').offset().top - parseFloat($('#sidebar').css('marginTop').replace(/auto/, 0)); 337 var footTop = null; 338 if($('.newsletter-area').length>0){ 339 footTop = $('.newsletter-area').offset().top - parseFloat($('.newsletter-area').css('marginTop').replace(/auto/, 0)); 340 } else if($('.ts-footer').length>0){ 341 footTop = $('.ts-footer').offset().top - parseFloat($('.ts-footer').css('marginTop').replace(/auto/, 0)); 342 } 343 else{ 344 footTop = $('.copy-right').offset().top - parseFloat($('.copy-right').css('marginTop').replace(/auto/, 0)); 345 } 346 347 348 var maxY = footTop - $('#sidebar').outerHeight(); 349 350 $(window).scroll(function(evt) { 351 var y = $(this).scrollTop(); 352 353 if($(window).width() > 991) 354 { 355 if (y > top) { 356 357 if (y < maxY) { 358 $('#sidebar').addClass('fixed').removeAttr('style'); 359 } else { 360 361 362 $('#sidebar').removeClass('fixed').css({ 363 364 top: (maxY - top) + 'px', 365 position: 'relative', 366 }); 367 } 368 } else { 369 370 $('#sidebar').removeClass('fixed'); 371 } 372 } 373 374 }); 375 376 } 377 378 379 /* ----------------------------------------------------------- */ 380 /*single post gallery slider 381 /* ----------------------------------------------------------- */ 382 if($('#single-post-sync-slider1').length > 0){ 383 384 var sync1 = $("#single-post-sync-slider1"); 385 var sync2 = $("#single-post-sync-slider2"); 386 var syncedSecondary = true; 387 388 sync1.owlCarousel({ 389 items : 1, 390 slideSpeed : 2000, 391 autoplayHoverPause:false, 392 nav: true, 393 autoplay: false, 394 dots: false, 395 loop: true, 396 navText: ["<i class='fa fa-angle-left'></i>", "<i class='fa fa-angle-right'></i>"], 397 responsiveRefreshRate : 200, 398 }).on('changed.owl.carousel', syncPosition); 399 400 sync2 401 .on('initialized.owl.carousel', function () { 402 sync2.find(".owl-item").eq(0).addClass("current"); 403 }) 404 .owlCarousel({ 405 items : 4, 406 dots: false, 407 nav: false, 408 smartSpeed: 200, 409 slideSpeed : 500, 410 slideBy: 1, 411 margin: 10, 412 responsiveRefreshRate : 100, 413 responsive: { 414 0: { 415 items: 3, 416 }, 417 500: { 418 items: 3, 419 }, 420 768: { 421 items: 3, 422 }, 423 1000: { 424 items:4, 425 } 426 } 427 428 }).on('changed.owl.carousel', syncPosition2); 429 430 function syncPosition(el) { 431 432 var count = el.item.count-1; 433 var current = Math.round(el.item.index - (el.item.count/2) - .5); 434 435 if(current < 0) { 436 current = count; 437 } 438 if(current > count)Â { 439 current = 0; 440 } 441 442 //end block 443 444 sync2 445 .find(".owl-item") 446 .removeClass("current") 447 .eq(current) 448 .addClass("current"); 449 var onscreen = sync2.find('.owl-item.active').length - 1; 450 var start = sync2.find('.owl-item.active').first().index(); 451 var end = sync2.find('.owl-item.active').last().index(); 452 453 if (current > end) { 454 sync2.data('owl.carousel').to(current, 100, true); 455 } 456 if (current < start) { 457 sync2.data('owl.carousel').to(current - onscreen, 100, true); 458 } 459 } 460 461 function syncPosition2(el) { 462 if(syncedSecondary) { 463 var number = el.item.index; 464 sync1.data('owl.carousel').to(number, 100, true); 465 } 466 } 467 468 sync2.on("click", ".owl-item", function(e){ 469 e.preventDefault(); 470 var number = $(this).index(); 471 sync1.data('owl.carousel').to(number, 300, true); 472 }); 473 474 } 475 476 477 /*========================================================== 478 Preloader 479 ======================================================================*/ 480 $(window).on('load', function () { 481 482 setTimeout(() => { 483 $('#preloader').addClass('loaded'); 484 }, 1000); 485 486 }); 487 488 // preloader close 489 $('.preloader-cancel-btn').on('click', function (e) { 490 e.preventDefault(); 491 if (!($('#preloader').hasClass('loaded'))) { 492 $('#preloader').addClass('loaded'); 493 } 494 }); 495 496 497} ); 498 499
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.