Imagenes proporcionales

This commit is contained in:
2020-06-18 00:29:07 -04:00
parent b64185c0b7
commit 0f26b53546
18 changed files with 48 additions and 4 deletions

View File

@ -75,7 +75,28 @@ let eventos = {
$(".servicio[data-filter='" + filter + "']").addClass('active')
eventos.current_tab = filter
},
resizeThumbs: () => {
let thumbs = $('#eventos_cards .image img')
thumbs.each((i, el) => {
let src = $(el).attr('src')
if (src == '#') {
return
}
let w = el.width
let h = el.height
let parent = $(el).parent()
let r = w / h
if (r > 1) {
$(el).height(parent.height())
$(el).width(parent.height() * r)
} else {
$(el).width(parent.width())
$(el).height(parent.width() / r)
}
})
},
setup: () => {
eventos.resizeThumbs()
$('.servicio').click(function(e) {
e.preventDefault()
let filter = $(this).attr('data-filter')