Created
May 21, 2017 00:27
-
-
Save monecchi/363604e0e14f7f02dc9e27eff457b68a to your computer and use it in GitHub Desktop.
Helper js function for responsive jQuery Spectragram plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Helper function for responsive jQuery Spectragram | |
* @require - jquery-spectragram.js plugin - https://github.com/adrianengine/jquery-spectragram | |
*/ | |
// Target the spectragram's wrapper as per the plugin's docs: | |
var insta = jQuery('#instagram_feed'); | |
// Check for the wrapper's presence in the DOM | |
if (insta.length) { | |
!function(a){jQuery.fn.responsiveInstagram=function(b){var c,d,e,f=a(this),g=a(window).width();return e={width:610,extraHeight:80,breakpoint:620},b=a.extend(e,b),g<=b.breakpoint?f.css("width","100%"):f.css("width",b.width.toString(10)+"px"),c=f.width(),d=Math.round(c+b.extraHeight),f.css("height",d.toString(10)+"px"),this}}(jQuery); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment