Last active
January 22, 2020 14:28
-
-
Save teomanofficial/dbf8db478c4768d53cbcccb0aac115fa to your computer and use it in GitHub Desktop.
This file contains 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
// fixed width and height | |
$('#banner').cropper({ | |
movable: false, | |
resizable: false, | |
rotatable: false, | |
dragCrop: false, | |
dragMode: 'move', | |
cropBoxResizable: false, | |
responsive: true, | |
// viewMode: 1, | |
ready: function () { | |
width = document.getElementById('banner').width; | |
heigth = document.getElementById('banner').height; | |
var cropheigth = 350; | |
if (width => 1400) { | |
cropheigth = width * 4 / 16; | |
if (cropheigth <= 350) { | |
cropheigth = 350 | |
} | |
} | |
$('#banner').cropper('setData', { | |
height: cropheigth, | |
width: width, | |
}); | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment