Commit 3b6f61bc9c11d96418a39a1d5fe616e7e283f0a0

Authored by Alexey Boroda
1 parent cf249006

-Simple spoiler

-Couple of fixes
frontend/views/site/index.php
@@ -126,9 +126,11 @@ $this->title = "Главная"; @@ -126,9 +126,11 @@ $this->title = "Главная";
126 </div> 126 </div>
127 </section> 127 </section>
128 <section class="main-box5"> 128 <section class="main-box5">
129 - <div class="spoil">  
130 - <p>На одной из центральных улиц Киева (був. Леси Украинки, 23) расположился шоу-рум «Баккара», в котором можно познакомиться с тщательно отобранными образцами продукции и многочисленными каталогами самых известных и надежных поставщиков Европы и всего мира...</p>  
131 - <div class="more"><a href="#">Узнать больше</a></div> 129 + <div class="simple-spoiler just-closed" style="height: 50px">
  130 + <p>Идейные соображения высшего порядка, а также дальнейшее развитие различных форм деятельности влечет за собой процесс внедрения и модернизации новых предложений. Равным образом начало повседневной работы по формированию позиции обеспечивает широкому кругу (специалистов) участие в формировании системы обучения кадров, соответствует насущным потребностям. Идейные соображения высшего порядка, а также начало повседневной работы по формированию позиции в значительной степени обуславливает создание форм развития. С другой стороны консультация с широким активом способствует подготовки и реализации новых предложений. Значимость этих проблем настолько очевидна, что реализация намеченных плановых заданий требуют от нас анализа соответствующий условий активизации. </p>
  131 + </div>
  132 + <div class="just-more">
  133 + <a href="#">Узнать больше</a>
132 </div> 134 </div>
133 </section> 135 </section>
134 </div> 136 </div>
frontend/web/css/style.css
@@ -415,11 +415,11 @@ footer .socbuts a:hover{ @@ -415,11 +415,11 @@ footer .socbuts a:hover{
415 letter-spacing: 0.4px; 415 letter-spacing: 0.4px;
416 font-family: 'Lato-Medium'; 416 font-family: 'Lato-Medium';
417 } 417 }
418 -.more{ 418 +.just-more, .more{
419 display: flex; 419 display: flex;
420 justify-content: flex-end; 420 justify-content: flex-end;
421 } 421 }
422 -.more a{ 422 +.just-more a,.more a{
423 float: right; 423 float: right;
424 text-transform: uppercase; 424 text-transform: uppercase;
425 font-size: 11px; 425 font-size: 11px;
@@ -431,7 +431,7 @@ footer .socbuts a:hover{ @@ -431,7 +431,7 @@ footer .socbuts a:hover{
431 border: 2px solid #d2d2d2; 431 border: 2px solid #d2d2d2;
432 color:#9e9e9e; 432 color:#9e9e9e;
433 } 433 }
434 -.more a:hover { 434 +.just-more a:hover, .more a:hover {
435 border: 2px solid #d2d2d2; 435 border: 2px solid #d2d2d2;
436 color:#fff; 436 color:#fff;
437 background-color: #d2d2d2!important; 437 background-color: #d2d2d2!important;
@@ -702,7 +702,7 @@ footer .socbuts a:hover{ @@ -702,7 +702,7 @@ footer .socbuts a:hover{
702 .textile_bottom{ 702 .textile_bottom{
703 float: left; 703 float: left;
704 margin: 80px 50px; 704 margin: 80px 50px;
705 - width: 100%; 705 + /*width: 100%;*/
706 } 706 }
707 .textile_bottom.tb1{ 707 .textile_bottom.tb1{
708 margin-top: 73px; 708 margin-top: 73px;
@@ -747,7 +747,9 @@ footer .socbuts a:hover{ @@ -747,7 +747,9 @@ footer .socbuts a:hover{
747 margin-top: -17px; 747 margin-top: -17px;
748 margin-bottom: 16px; 748 margin-bottom: 16px;
749 } 749 }
750 -.spoiler{display: none;width:100%!important;} 750 +.simple-spoiler {
  751 + overflow: hidden;
  752 +}
751 .text_left{ 753 .text_left{
752 padding-left: 100px; 754 padding-left: 100px;
753 padding-right: 40px; 755 padding-right: 40px;
@@ -1094,6 +1096,10 @@ footer .socbuts a:hover{ @@ -1094,6 +1096,10 @@ footer .socbuts a:hover{
1094 .button3{ 1096 .button3{
1095 margin: 11px 0px; 1097 margin: 11px 0px;
1096 } 1098 }
  1099 +.spoiler {
  1100 + display: none;
  1101 + width: 100% !important;
  1102 +}
1097 .spoiler .control-label{display: none;} 1103 .spoiler .control-label{display: none;}
1098 .spoiler input[type=checkbox], input[type=radio] { 1104 .spoiler input[type=checkbox], input[type=radio] {
1099 margin: 1px 0 0; 1105 margin: 1px 0 0;
frontend/web/js/script.js
@@ -55,4 +55,17 @@ $(document).ready(function(){ @@ -55,4 +55,17 @@ $(document).ready(function(){
55 }); 55 });
56 $(".punkt").parent().find(".spoiler input[type='checkbox']:checked").parent().addClass("l_check").parent().parent().parent().show().parent().find(".punkt").addClass('opened'); 56 $(".punkt").parent().find(".spoiler input[type='checkbox']:checked").parent().addClass("l_check").parent().parent().parent().show().parent().find(".punkt").addClass('opened');
57 57
  58 + $(document).on('click', '.just-more', function (event) {
  59 + event.preventDefault();
  60 + var spoilerInitialHeight = $('.simple-spoiler');
  61 + var spoilerFullHeight = $('.simple-spoiler p').height();
  62 + if($(".simple-spoiler").hasClass("just-closed")) {
  63 + $('.just-more a').text("Скрыть");
  64 + $('.simple-spoiler').animate({height: spoilerFullHeight}, 1000);
  65 + } else {
  66 + $('.just-more a').text("Узнать больше");
  67 + $('.simple-spoiler').animate({height: 50}, 1000)
  68 + }
  69 + $(".simple-spoiler").toggleClass("just-closed");
  70 + });
58 }); 71 });
59 \ No newline at end of file 72 \ No newline at end of file