javascript - Using jQuery Masonry Many times in the same site -


i'm trying use jquery masonry 3 times on same site. each code block works independently when trying use 3 @ once, last 1 works. how can combine these work yet keep different values , selectors each has?

/** first instance **/     var $container = $('.smallcolwrap');         $container.imagesloaded(function(){           $container.masonry({             itemselector : '.smallcol',             columnwidth: function( containerwidth ) {                 return containerwidth / 3; },             isanimated: true           });         });      /** second instance **/     var $container = $('.slickr-flickr-gallery');         $container.imagesloaded(function(){           $container.masonry({             itemselector : 'li',             columnwidth: 160,             isanimated: true           });         });      /** third instance **/       var $container = $('.navigationhome');         $container.imagesloaded(function(){           $container.masonry({             itemselector : 'li',             columnwidth: function( containerwidth ) {                 return containerwidth / 2; },             isanimated: true,                 animationoptions: {                 duration: 250,                 easing: 'linear',                 queue: false                 }           });         });  

wow, kevin. i'm not js expert easy. happens after staring long @ this.

/** first instance **/ var $container = $('.smallcolwrap');     $container.imagesloaded(function(){       $container.masonry({         itemselector : '.smallcol',         columnwidth: function( containerwidth ) {             return containerwidth / 3; },         isanimated: true       });     });  /** second instance **/ var $container1 = $('.slickr-flickr-gallery');     $container1.imagesloaded(function(){       $container1.masonry({         itemselector : 'li',         columnwidth: 160,         isanimated: true       });     });  /** third instance **/   var $container2 = $('.navigationhome');     $container2.imagesloaded(function(){       $container2.masonry({         itemselector : 'li',         columnwidth: function( containerwidth ) {             return containerwidth / 2; },         isanimated: true,             animationoptions: {             duration: 250,             easing: 'linear',             queue: false             }       });     });  

Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -