From 638d92210b3e0d58e696afb04052137740c10447 Mon Sep 17 00:00:00 2001 From: Ed Lea Date: Wed, 17 Jul 2013 10:20:05 +0100 Subject: [PATCH] updating plugin to 0.3.0 to include the transition effects --- README.md | 71 +-------------------------------------- collageplus.jquery.json | 2 +- jquery.collagePlus.js | 2 +- jquery.collagePlus.min.js | 4 +-- 4 files changed, 5 insertions(+), 74 deletions(-) diff --git a/README.md b/README.md index 19794ba..384cf35 100644 --- a/README.md +++ b/README.md @@ -12,75 +12,6 @@ Example Try the [live example](http://collageplus.edlea.com/example.html "Live CollagePlus example") or play around with a [jsfiddle](http://jsfiddle.net/edlea/uZv3n/) version -Basic Usage ------------ -```javascript -$('.Collage').collagePlus(); -``` - - -Getting Started ---------------- -```CSS -/* In your CSS */ -.Collage img{ - - /* ensures padding at the bottom of the image is correct */ - vertical-align:bottom; - - /* hide the images until the plugin has run. the plugin will reveal the images*/ - opactiy:0; - - } -``` - - -Ensure you have no whitespace between your image tags for a clean grid. - -```HTML - -
- -
-``` - -Alternatively, use the jquery.removeWhitespace.js plugin in the extras directory to do this for you e.g. - -```javascript -$('.Collage').removeWhitespace().collagePlus(); -``` - -You may want to run the plugin with an image loader like https://github.com/desandro/imagesloaded, alternatively you can try it with - -```javascript -$(window).load(function () { - $('.Collage').collagePlus(); -}); -``` - -Browser Resize --------------- - -By default this behaviour not included in the plugin but you can use a few lines of js to reload the images if the user resizes the browser window - -```javascript -function collage() { - $('.Collage').collagePlus( - { - 'fadeSpeed' : 2000 - } - ); -}; - -var resizeTimer = null; -$(window).bind('resize', function() { - // hide all the images until we resize them - // set the element you are scaling i.e. the first child nodes of .Collage to opacity 0 - $('.Collage .Image_Wrapper').css("opacity", 0); - // set a timer to re-apply the plugin - if (resizeTimer) clearTimeout(resizeTimer); - resizeTimer = setTimeout(collage, 200); -}); -``` +For detailed usage instructions please visit http://collageplus.edlea.com/ \ No newline at end of file diff --git a/collageplus.jquery.json b/collageplus.jquery.json index c010954..b292446 100644 --- a/collageplus.jquery.json +++ b/collageplus.jquery.json @@ -9,7 +9,7 @@ "album", "masonry" ], - "version": "0.2.0", + "version": "0.3.0", "author": { "name": "Ed Lea", "url": "http://edlea.com" diff --git a/jquery.collagePlus.js b/jquery.collagePlus.js index d6cee8a..0853bd7 100644 --- a/jquery.collagePlus.js +++ b/jquery.collagePlus.js @@ -1,6 +1,6 @@ /*! * - * jQuery collagePlus Plugin v0.2.0 + * jQuery collagePlus Plugin v0.3.0 * https://github.com/ed-lea/jquery-collagePlus * * Copyright 2012, Ed Lea twitter.com/ed_lea diff --git a/jquery.collagePlus.min.js b/jquery.collagePlus.min.js index 4a19d01..3f832fe 100644 --- a/jquery.collagePlus.min.js +++ b/jquery.collagePlus.min.js @@ -1,6 +1,6 @@ /*! * - * jQuery collagePlus Plugin v0.2.0 + * jQuery collagePlus Plugin v0.3.0 * https://github.com/ed-lea/jquery-collagePlus * * Copyright 2012, Ed Lea twitter.com/ed_lea @@ -12,4 +12,4 @@ * http://www.opensource.org/licenses/GPL-2.0 * */ -;(function(e){e.fn.collagePlus=function(t){function r(t,n,r){var s=r.padding*(t.length-1)+t.length*t[0][3],o=r.albumWidth-s,u=o/(n-s),a=s;for(var f=0;fn.albumWidth&&i.length!=0){r(i,t-n.padding,n);delete t;delete i;t=0;i=[]}if(n.images.length-1==o&&i.length!=0){r(i,t,n);delete t;delete i;t=0;i=[]}})})}})(jQuery); \ No newline at end of file +;(function(e){e.fn.collagePlus=function(t){function r(t,n,r,s){var o=r.padding*(t.length-1)+t.length*t[0][3],u=r.albumWidth-o,a=u/(n-o),f=o;for(var l=0;ln.albumWidth&&i.length!=0){r(i,t-n.padding,n,o);delete t;delete i;t=0;i=[];o+=1}if(n.images.length-1==u&&i.length!=0){r(i,t,n,o);delete t;delete i;t=0;i=[];o+=1}})})}})(jQuery); \ No newline at end of file