Last active
August 29, 2015 14:03
-
-
Save xpander54/ac0e9d80d05636926dbb to your computer and use it in GitHub Desktop.
picture it carousel img height
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
.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