This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function tabsSelect(tab, contentTab, callback) { | |
| var tcl = $(tab); | |
| var ct = $(contentTab); | |
| tcl.click(function () { | |
| if (!$(this).hasClass('active')) { | |
| tcl.removeClass('active') | |
| var i = $(this).index(); | |
| $(this).addClass('active'); | |
| ct.children().removeClass('active').hide().eq(i).addClass('active').fadeIn(300); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const btn = document.querySelector('.btn-get-posts'); | |
| const btnAddPost = document.querySelector('.btn-add-post'); | |
| const container = document.querySelector('.container'); | |
| function getPosts(cb) { | |
| const xhr = new XMLHttpRequest(); | |
| xhr.open('GET', 'https://jsonplaceholder.typicode.com/posts'); | |
| xhr.addEventListener('load', () => { | |
| const response = JSON.parse(xhr.responseText); | |
| cb(response); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // jquery | |
| $('#text').click(function (e) { | |
| var val = $('#input').val(); | |
| if (val != '') { | |
| if (/[^[+0-9]/.test(val)) { | |
| var pattern = /^([a-z0-9_\.-])+@[a-z0-9-]+\.([a-z]{2,4}\.)?[a-z]{2,4}$/i; | |
| if (pattern.test(val)) { | |
| // $('#valid').text('E-mail введен верно'); | |
| } else { | |
| $('#valid').text('Не верно введен e-mail'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let Tabs = function() { | |
| let link = $('#tabs-link'), | |
| content = $('#tabs-wrap'), | |
| i = 0, | |
| createTabs = function () { | |
| function tabsLink(i) { | |
| $(link).children(".title-item").removeClass("active"); | |
| $(link).children(".title-item").eq(i).addClass("active"); | |
| } | |
| function tabsContent(i){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="counter"> | |
| <button type="button" class="but counterBut dec">-</button> | |
| <input type="text" class="field fieldCount" value="1" data-min="1" data-max="20"> | |
| <button type="button" class="but counterBut inc">+</button> | |
| </div> | |
| <script> | |
| function catalogItemCounter(field){ | |
| var fieldCount = function(el) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Product Card Height | |
| function productHeight(){ | |
| if ( $( window ).width() > 768 ){ | |
| let productHeight = {}; | |
| // создаем массив стартовых высот блоков с продуктами | |
| $(".product").each(function(index){ | |
| let height = $(this).outerHeight(); | |
| productHeight[index] = height; | |
| console.log("before: " + productHeight[index] ); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| require_once dirname(__FILE__).'/config.core.php'; | |
| include_once MODX_CORE_PATH . 'model/modx/modx.class.php'; | |
| $modx= new modX(); | |
| $modx->initialize('mgr'); | |
| $modx->setLogLevel(modX::LOG_LEVEL_INFO); | |
| $modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML'); | |
| header("Content-type: text/plain"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // provider id => array of packages | |
| $listPackagesToInstall = array( | |
| 1 => array( // standart modx provider | |
| 'sdStore' | |
| , 'translit' | |
| , 'TinyMCE' | |
| , 'FormIt' | |
| , 'Analytics' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| HTML: | |
| <div class="wrapper"> | |
| <div class="tabs"> | |
| <span class="tab">Вкладка 1</span> | |
| <span class="tab">Вкладка 2</span> | |
| <span class="tab">Вкладка 3</span> | |
| </div> | |
| <div class="tab_content"> | |
| <div class="tab_item">Содержимое 1</div> | |
| <div class="tab_item">Содержимое 2</div> |
NewerOlder