diff --git a/README.md b/README.md index 7d2ad01..1ee485b 100644 --- a/README.md +++ b/README.md @@ -47,8 +47,8 @@ Add CSS Files: - - + + ``` Add JS Files: diff --git a/index.html b/index.html index efb4a5a..3f5ca2f 100644 --- a/index.html +++ b/index.html @@ -10,8 +10,8 @@ - - + + @@ -41,8 +41,8 @@

#Hashtegny


- +
diff --git a/js/hashtegny.js b/js/hashtegny.js index b707b9c..2908c6b 100644 --- a/js/hashtegny.js +++ b/js/hashtegny.js @@ -355,8 +355,11 @@ if(plugin.curLayout === "grid"){ // if current layout is grid, then destroy, then fadeIn new appended posts (if any), and apply grid layout + // in case of first time, just add class 'grid' instead of destroying previous grid layout // this code instead of using: http://masonry.desandro.com/methods.html#prepended - $(targetEle).masonry('destroy'); + if(!$(targetEle).hasClass('grid')){ + $(targetEle).addClass('grid'); + }else $(targetEle).masonry('destroy'); $(targetEle).children('.mainPost').fadeIn(); $(targetEle).masonry(_options); @@ -372,7 +375,7 @@ // So, empty the targetEle, then setTimeout, then add html again, and apply grid var _html = $(targetEle).html(); $(targetEle).html(""); - setTimeout(function(){$(targetEle).html(_html).masonry(_options)}, 100); + setTimeout(function(){$(targetEle).html(_html).masonry(_options)}, 1000); } }, @@ -581,8 +584,8 @@ // whether the plugin is progress(i.e. waiting for all ajax calls to be loaded) inProgress: false, - // track current layout, default is animation - curLayout: "animation", + // track current layout, default is grid + curLayout: "grid", // initialization for the plugin init: function(){