F
F
finok2015-11-14 16:08:01
JavaScript
finok, 2015-11-14 16:08:01

How to make the calculator immediately open?

How to make the calculator immediately open https://jsfiddle.net/x8m390c6/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Vitrenko, 2015-11-14
@Vestail

In the version that you uploaded to jsfiddle.net, in my chrome, the button does not work at all. I'll tell you how to do it for the version that was on the Yandex disk.
1. In index.html we replace
on the
2. In style.css we replace

.box-price {
  background: #DDDDDD;
  color: #333;
  padding: 0 15px;
  overflow: hidden;
  height: 0px;
}

on the
.box-price {
  background: #DDDDDD;
  color: #333;
  padding: 0 15px;
  overflow: hidden;
  height: 390px;
}

3. In script.js remove this completely
$('.price-button').click(function() {
    var boxPrice = $(this).closest('.col-md-4');

    function hideButton () {
      $(boxPrice).find('.price-button').hide();
      $(boxPrice).find('.footer-price').append('<h4>Итог: <span class="cur"></span> <span class="rub">р. / м.кв.</span></h4>');

    };
    //анимация раскрытия блока с параметрами
    $(boxPrice).find('.box-price').animate({height: '390px'}, {'duration': 500}, {'easing': 'linear'}, hideButton());

  });

Done: https://jsfiddle.net/x8m390c6/2/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question