I would like to use a jQuery BeforeAndAfter plugin in my angularJS app. But I have a several images with different dimensions. I have tried to set width and height dynamically but it is not working. Like this:
<div id="container">
<img id="imgMY" ng-src="{{photo.source}}" alt="photo" width="{{photo.width}}" height="{{photo.height}}"/>
<img id="imgM2" ng-src="{{photo.source}}" alt="photo" width="{{photo.width}}" height="{{photo.height}}"/>
</div>
...
<script type="text/javascript">
$(function(){
$('#container').beforeAfter({
animateIntro : true,
introDelay : 1000,
introDuration : 500,
showFullLinks : false,
dividerColor : '#1481E3'
});
});
</script>
It works only when I have those attributes hardcoded. How can I figure it out?