Tiggles ツ of Speak Creative
10/11/2019 - 1:13 PM

Autoheight Hero to image

have a client insisting on using images with text? put this puppy within ur doc.ready. may need to adjust the hero placeholder class/id per site.

ie: http://cloud.madebyspeak.com/1255b5

if ($(".default-hero .templatecontent.text").length) {
  jQ171(window).on("load resize", function() {
    $(".default-hero-wrap").each(function() {
      var imageHeight = $(this).find("img").outerHeight();
      $(".default-hero, .default-hero-wrap").css({
        "min-height": imageHeight + "px",
        "height": imageHeight + "px"
      })
    })
  })
}