Skip to content

Instantly share code, notes, and snippets.

@xpander54
Last active August 29, 2015 14:03
Show Gist options
  • Save xpander54/ac0e9d80d05636926dbb to your computer and use it in GitHub Desktop.
Save xpander54/ac0e9d80d05636926dbb to your computer and use it in GitHub Desktop.
picture it carousel img height
.directive('imgHeightFix', function() {
return {
restrict: 'A',
link: function (scope, element, attrs) {
//var h = $(element).attr('img-height');
var fixCarousel = function (imgHeight) {
var imgH = parseInt(imgHeight.split('px')[0]) / 2;
var deviceH = $(window).height() / 2;
alert(imgH);
//var halfHeight= deviceH - imgH;
//$("carousel-pictures-content img").css( "margin-top", "400px");
};
//setTimeout({fixCarousel(h)}, 2000);
fixCarousel(attrs.imgHeightFix);
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment