Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(window).resize(function(){
- setImagesTopMargin();
- });
- $('.slider > div .photos img').each( function( ){
- if($(window).width()>640)
- {
- var ratio = $(this).attr('data-width')/$(this).attr("data-height");
- var newHeight = $(window).width()/ratio;
- var marginTop = newHeight/(-2);
- $(this).css("margin-top", marginTop+"px");
- }
- } );
Add Comment
Please, Sign In to add comment