Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Change setIsotope function in script.js
- function setIsotope(){
- if( jQuery(window).width() >= mobile_width && !isotope_set ){
- isotope_set = true;
- /* Works with Infinite Scroll version 2.0b2.120519 */
- jQuery('.sort, #sort').isotope( {
- itemSelector : '.box:not(.invis)',
- //transformsEnabled: true, // must be default to avoid Opera conflict (should be false for Opera and true for other browsers)
- masonry: { columnWidth : 175 }
- });
- }
- }
- // Infinite Scroll Setup
- (function($) {
- $(function(){
- // Initialize Infinite Scroll
- var $container = $('.sort');
- $container.isotope({itemSelector : '.all'});
- $container.infinitescroll({
- navSelector : '.navigation', // selector for the paged navigation
- nextSelector : '.nav-previous a', // selector for the NEXT link (to page 2)
- itemSelector : '.all', // selector for all items you'll retrieve
- loading : {
- img : '<?php echo get_stylesheet_directory_uri(); ?>/images/inf-loading-icon.gif',
- msgText : "Loading..",
- finishedMsg : "Ill see you at the crossroads so you wont be lonely"
- },
- behaviour : 'twitter',
- errorCallback: function() {
- // fade out the error message after 2 seconds
- $('#infscr-loading').animate({opacity: 0.8},2000).fadeOut('normal');
- }
- },
- // call Isotope as a callback
- function( newElements, data ) {
- var $newElems = $(newElements).css({ opacity: 0 }); // hide new items while they are loading
- $newElems.imagesLoaded(function(){ // ensure that images load before adding to masonry layout
- $newElems.animate({ opacity: 1 }); // show elems now they're ready
- $container.isotope( 'insert', $newElems); // resort new isotope content ('insert' preserves current filter, 'appended' does not)
- $newElems.each(function(){
- // Fancybox init
- $(this).find("a[rel='gallery'], a[rel='lightbox'], .gallery-icon a, .colorbox").fancybox({
- padding: 0,
- overlayColor: "#000",
- overlayOpacity: 0.85,
- titleShow: false
- });
- // Slides init
- $(this).find('.slider').slides({
- play: 9500,
- pause: 2500,
- hoverPause: true,
- effect: 'fade',
- generatePagination: false
- });
- // Share icons
- $(this).find('.share-window').on('click', function(){
- var width = 650;
- var height = 500;
- var left = (screen.width - width)/2;
- var top = (screen.height - height)/2;
- var params = 'width='+width+', height='+height;
- params += ', top='+top+', left='+left;
- params += ', directories=no';
- params += ', location=no';
- params += ', menubar=no';
- params += ', resizable=no';
- params += ', scrollbars=no';
- params += ', status=no';
- params += ', toolbar=no';
- newwin=window.open($(this).attr('href'),'Share', params);
- if (window.focus) {newwin.focus();}
- return false;
- });
- // FitVids init
- $(this).find('.vid-container').fitVids();
- });
- });
- });
- $(document).ajaxError(function(e,xhr,opt){
- // remove 404 error 'page 2 not found'
- if (xhr.status == 404) jQuery('.navigation .nav-previous a').remove();
- });
- });
- })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement