laverie_app/app/assets/javascripts/application.js.coffee
Nicolas Bally 7d69da3aba suite
2019-06-11 15:38:12 +02:00

27 lines
819 B
CoffeeScript

#= require jquery
#= require jquery_ujs
#= require_tree .
resize = () ->
$(".electrolux2_img .img").css("padding-top", ($(".electrolux2_img").height() - $(".electrolux2_img img").height())/ 2)
$(".miele_img .img").css("padding-top", ($(".miele_img").height() - $(".miele_img img").height())/ 2)
$(".gold_img .img").css("padding-top", ($(".gold_img").height() - $(".gold_img img").height())/ 2)
$(".with_ratio").each ->
ratio = parseFloat($(this).data("ratio"))
height = $(this).width()*ratio
$(this).css("height",height+"px")
#$(".panels").css("top", ($(window).height() - $(".row").height())/ 2)
$ ->
resize()
$(window).bind "resize", ->
resize()
$(".electrolux, .miele, .gold").click (event) ->
window.location.href = $(this).find("a:first").attr("href")