/extras/jquery.collageCaption.min.js
https://github.com/vandersonarruda/jquery-collagePlus · JavaScript · 16 lines · 1 code · 0 blank · 15 comment · 0 complexity · 133d3754d58b5b9d7b32924283e16710 MD5 · raw file
- /*!
- *
- * jQuery collageCaption Plugin v0.1.0
- * extra for collagePlus plugin
- * https://github.com/ed-lea/jquery-collagePlus
- *
- * Copyright 2012, Ed Lea twitter.com/ed_lea
- *
- * built for http://qiip.me
- *
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.opensource.org/licenses/GPL-2.0
- *
- */
- (function(a){a.fn.collageCaption=function(b){var c=a.extend({images:a(this).children(),background:"black",opacity:"0.5",speed:100,"class":"Caption"},b);return this.each(function(){var b=0,d=[];c.images.each(function(b){var d=a(this);if(typeof d.data("caption")=="undefined"){return}var e='<div class="'+c.class+'" style="position:relative;"><div class="Caption_Background" style="background-color:'+c.background+";opacity:"+c.opacity+';position:relative;top:0;"></div><div class="Caption_Content" style="position:relative;">'+d.data("caption")+"</div></div>";d.append(e);var f=d.find("."+c.class),g=d.find(".Caption_Background"),h=d.find(".Caption_Content");var i=f.height();g.height(i);h.css("top","-"+i+"px");d.bind({mouseenter:function(a){f.animate({top:-1*i},{duration:c.speed,queue:false})},mouseleave:function(a){f.animate({top:0},{duration:c.speed,queue:false})}})});return this})}})(jQuery)