-
Similar Content
-
By jksnf
Не работает transition при появлений модального окна:
<a class="btn">Modal</a> <div class="modal"> <div class="overlay"> <div class="content"> <a class="close">X</a> <h1>Title</h1> <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt repellat asperiores rerum animi officiis minus corporis iure voluptate accusantium, ut optio ratione iusto nemo delectus. Quasi illum libero dolorum neque?</p> </div> </div> </div> //scss .modal .overlay{ position: fixed; top: 0;left: 0; width: 100%;height: 100%; background: rgba($color: #000000, $alpha: .8); z-index: 1; display: none; } .modal .content{ width: 500px;height: 200px; position: absolute; top: 50%;left: 50%; transform: translate(-50%, -50%); background-color: #fff; z-index: 2; text-align: center; display: none; a{ line-height: 30px; font-weight: bold; color: #fff; top: -50px;; position: absolute; right: -50px; font-size: 40px; padding: 10px; } h1{ margin-bottom: 20px; } } .modal.active .overlay{ display: block; } .modal.active .content{ display: block; } //Jquery $(document).ready(function(){ $(".btn, .close").click(function() { $(".modal").toggleClass("active") }) }) Я понимаю что на display не работает transition. но и нельзя ставить opacity т.к перекрывает контент сзади него изначально.
Что делать?
-
By IsayR
Всем привет! Подскажите, пожалуйста, как правильно сделать раскрывающиеся блоки со скрытым содержанием внутри? У меня в принципе все работает, блок открывается и закрывается, НО если я нажимаю на блок, а не на стрелочку, она у меня остается в таком же положении(а она должна у меня меняться, когда блок открывается), и получается куча мала, и выглядит это не очень презентабельно. Подскажите, пожалуйста!
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <div class="wrapper-div"> <div class="div"> <div class="window-one"> <h3 class="title"> Заголовок 1 </h3> <div class="arrow-test"></div> </div> <div class="window-two"> <div class="text">Текст 1</div> </div> </div> </div> <div class="wrapper-div"> <div class="div"> <div class="window-one"> <h3 class="title"> Заголовок 2 </h3> <div class="arrow-test"></div> </div> <div class="window-two"> <div class="text">Текст 2</div> </div> </div> </div> <div class="wrapper-div"> <div class="div"> <div class="window-one"> <h3 class="title"> Заголовок 3 </h3> <div class="arrow-test"></div> </div> <div class="window-two"> <div class="text">Текст 3</div> </div> </div> </div> .div{ border: 1px solid #3A444E; border-radius: 10px; width: 300px; height: 64px; overflow: hidden; } .div.open { height: auto; background: #000; color: #fff; } .window-one { display: flex; align-items: center; justify-content: space-between; } .title { margin-bottom: 20px; } .arrow-test { content: ''; background: url('http://cdn.onlinewebfonts.com/svg/img_387044.png') no-repeat center center / 100%; width: 30px; height: 30px; cursor: pointer; } .arrow-test.open { content: ''; background: url('https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Eo_circle_yellow_arrow-up.svg/1024px-Eo_circle_yellow_arrow-up.svg.png') no-repeat center center / 100%; width: 30px; height: 30px; cursor: pointer; } $('.div, .arrow-test').click( function(){ $(this).toggleClass('open')});
-
By Алеся
Всем привет! Хотела бы представить свою работу новичка на обсуждение для получения конструктивной критики и/или советов, взглядов что можно улучшить или изменить, общее впечатление, конечно, тоже интересует. https://alesia-k.github.io/Tajam-template/
Обратите, пожалуйста, внимание на:
- блок "MEET OUR AMAZING TEAM". Немного не нравится как смещаются item при наведении мыши, как будто немного дергаются. Так ли по-вашему это должно работать или такое поведение блока нужно изменить?
- инпут "subscribe" в футторе. При клике на инпут, немного смещается и сам инпут, и рядом стоящая кнопка. Было бы классно, если бы подкинули идею как сделать, чтобы такого не было.
- и почему-то при клике на <a href="tel:(+62)2122243333">(+62)21-2224 3333</a> не идет процесса соединения.
Заранее спасибо!
-
By Only091
Помогите пожалуйста, не получается сделать постраничную навигацию. Делал все по урокам. в Итоге получилось сделать два разных каталога один с фильтрами другой с постраничной навигацией. И теперь я пытаюсь объединить два каталога. Но не получается. Сами файлы урока в архике каталог. Буду очень благодарен если мне помогут! catalog.phpcatalogDB.js
каталог.7z
-
By Alexand
Здравствуйте дорогие специалисты програмирования.
Взываю вас о помощи!? Прощу Вас уделите мне своё безценное время. Я который раз выполняю тестовое задание для трудоустройства, а мне постоянно отказывают. Я уже в замешательстве, что же я делаю не так. Я просил их, дать мне хоть какую-то критику, единственное что мне отвечают СЛАБО. Но что именно слабо не говорят!
Прошу Вас рассмотреть мою из последних тестовую работу и укозать мне ВСЕ мои прогрехи, по полной строгости. Единственная надежда на Вашу благосклонность и доброту.
Вот ссылка на гитхаб - https:/github.com/ShusevA/ARI-AJAX-Application
Требоватие к этой работе https://docs.google.com/document/d/10gLPHDqGNMDSeSQbYfG8RVtXR3XQOrchSBmd50OzJ_s/edit
С уважением к Вам, за ранее спасибо.
-
Question
Vitalya T
Добрый день. Хочу совместить Jquery UI slider и ajax галерею.
Проблема в том, что при изменении рейнджа больше чем на один шаг, изображения не проматываются адекватно. При изменении диапазона на один шаг, скрипт работает нормально.
Видео:
http://screencast.com/t/loDxRlNEncq
Сэмпл кода в котором это обрабатывается:
var ScrollToright= function (Steps){ console.log ("Steps!!!!!!!!! "+Steps); th.find('li').stop(true, true) var next_li = th.find('li.showed:last').next() if(next_li.length!=1) return; var all_li = th.find('li.showed:not(:first)') var first_li = th.find('li.showed:first'); var additionalCollection = th.find('li.showed:first'); var trueIndexli = th.find('li.showed:first').index()-1; var next_li_add; console.log ("trueIndexli "+trueIndexli); /*for ( var i = 0; i < Steps; i++ ) { additionalCollection = additionalCollection.add(th.find('li.showed').eq(i)); }*/ for ( var i = 0; i < Steps; i++ ) { trueIndexli= trueIndexli+i; additionalCollection = additionalCollection.add(th.find('li').eq(trueIndexli)); } //additionalCollection.css('background','red'); //th.find('li.showed').eq(0).css('background','red'); //console.log("additionalCollection "+additionalCollection); //additionalCollection.css('background','red'); if (Steps>1){ first_li = additionalCollection; all_li = th.find('li').not(additionalCollection); next_li_add = additionalCollection.last().next(); next_li = next_li_add; } if (Steps>4) { all_li = additionalCollection.nextAll(); } next_li.addClass('showed').css('opacity', '0') var left = $(first_li).width()+20 first_li.animate( { 'left': '-'+left+'px', 'opacity': '0' }, __this__.speed, function(){ __this__.normalize($(this)) $(this).removeClass('showed'); __this__.check_nav(th) __this__.check_count(th); } ); all_li.animate( { 'left': '-'+left+'px' }, __this__.speed, function(){ __this__.normalize($(this)) } ); next_li.animate( { 'left': '-'+left+'px', 'opacity': '1' }, __this__.speed, function(){ __this__.normalize($(this)) } ); __this__.ajax_li(th, "right") //PUSH BACK totalCountinThisLoad= th.find("li").size(); if (totalCountinThisLoad > newcount1) newcount1 += totalCountinThisLoad-newcount; totalCountShow=th.find("li.showed").size(); totalCountLeft=totalCountinThisLoad-totalCountShow; // if (totalCountShow>5) totalCountShow = 5; totalCountLeft=totalCountinThisLoad-totalCountShow; Maxrange=(totalCountinThisLoad-totalCountShow+1)*10; $( ".slider1" ).slider( "option", "max", Maxrange); $( ".slider1" ).slider("value", $( ".slider1" ).slider("value") + Steps); if ( ( $( ".slider1" ).slider("value") == $( ".slider1" ).slider( "option", "max") ) && ( th.find('li.showed:last').nextAll("li").size()>0) ) { var remain = th.find('li.showed:last').nextAll("li").size(); $( ".slider1" ).slider("value", $( ".slider1" ).slider("value") - (remain*10) ); } }var ScrollToLeft = function(Steps) { var stepback = Math.abs(Steps); console.log ("Steps!!!!!!!!! "+stepback); th.find('li').stop(true, true) var next_li = th.find('li.showed:first').prev() if(next_li.length!=1) return; var last_li = th.find('li.showed:last') var additionalCollection = th.find('li.showed:last'); var trueindex = last_li.index(); var totalShowed = th.find('li.showed').length-1; //th.find('li.showed').eq(totalShowed).css('background','black'); console.log("totalShowed "+totalShowed); console.log("trueindex "+trueindex); for ( var i = 0; i <stepback; i++ ) { if (i<=4){ totalShowed = totalShowed-i; additionalCollection = additionalCollection.add(th.find('li.showed').eq(totalShowed)); } } if (stepback>1) last_li = additionalCollection; //additionalCollection.css('background','green'); var left = $(last_li).width()+20 var all_li = th.find('li.showed:not(:last)') next_li.addClass('showed').css('opacity', '0').css('left','-'+left+'px') all_li.css('left','-'+left+'px') last_li.css('left','-'+left+'px') last_li.animate( { 'left': 0+'px', 'opacity': '0' }, __this__.speed, function(){ __this__.normalize($(this)) $(this).removeClass('showed'); __this__.check_nav(th) __this__.check_count(th); } ); all_li.animate( { 'left': 0+'px' }, __this__.speed, function(){ __this__.normalize($(this))} ); next_li.animate( { 'left': 0+'px', 'opacity': '1' }, __this__.speed, function(){ __this__.normalize($(this))} ); __this__.ajax_li(th, "left") //PUSH BACK $( ".slider1" ).slider("value", $( ".slider1" ).slider("value") - 10); totalCountinThisLoad= th.find("li").size(); if (totalCountinThisLoad > newcount) newcount += totalCountinThisLoad-newcount; totalCountShow=th.find("li.showed").size(); totalCountLeft=totalCountinThisLoad-totalCountShow; totalCountLeft=totalCountinThisLoad-totalCountShow; $( ".slider1" ).slider( "option", "max", Maxrange); Prevli = th.find('li.showed:first').prevAll("li").size(); if ( ( $( ".slider1" ).slider("value") == 0 ) && ( th.find('li.showed:first').prevAll("li").size()>0 ) ) { $( ".slider1" ).slider("value", $( ".slider1" ).slider("value") + Prevli*10); }}th.find( ".slider1" ).bind( "slide", function(event, ui){ totalCountinThisLoad= th.find("li").size(); if (totalCountinThisLoad > newcount) newcount += totalCountinThisLoad-newcount; totalCountShow=th.find("li.showed").size(); totalCountLeft=totalCountinThisLoad-totalCountShow; totalCountLeft=totalCountinThisLoad-totalCountShow; Maxrange=(totalCountinThisLoad-totalCountShow+1)*10; $( ".slider1" ).slider( "option", "max", Maxrange); deltaValueStep = (ui.value-ValueOldOnSlide)/10; //console.log("deltaValueSte "+deltaValueStep); if ( ui.value>ValueOldOnSlide){ // console.log("step"+step); //console.log("Its scroll down") ScrollToright(deltaValueStep); } if ( ui.value<ValueOldOnSlide){ //console.log("Its scroll up") ScrollToLeft(deltaValueStep); } });Скрипт целиком: http://pastebin.com/LdqPPS7K
Ссылка на сайт, где можно попробовать, как работает скрипт: http://testing.site-services.ru/
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.