Плавная прокрутка до элемента на другой или на текущей странице jQuery | Smooth scrolling to an element on another or current page jQuery.
<a class="desktop-menu__item" href="/history/#year2021">
2021 год
| <body> | |
| <!-- Анимированный лоадер --> | |
| <div class="wrapper-preloader"> | |
| <video autoplay loop> | |
| <!-- or any preloader --> | |
| <source src='<?=SITE_TEMPLATE_PATH."/assets/preloader.mp4"?>' type="video/mp4"> | |
| <source src='<?=SITE_TEMPLATE_PATH."/assets/preloader.mov"?>' type="video/mp4"> | |
| </video> | |
| <style> | |
| .wrapper-preloader { |
| dependencies: | |
| * jquery-3.4.1 |
| <div class="section-map map"> | |
| <div class="map-open js-map-open-xs"> | |
| <p>Для открытия карты, кликните на нее</p> | |
| </div> | |
| <div id="map"></div> | |
| <script type="text/javascript" src="https://api-maps.yandex.ru/2.1/?lang=ru_RU"></script> | |
| <script> | |
| ymaps.ready(function() { | |
| var myMapBallon = { |
| //jqery method: | |
| $.getScript('js/_child-script.js', function() {/*dependet code*/}); | |
| //js method: | |
| var _childScript = document.createElement('script'); | |
| _childScript.src = '/js/_child-script.js'; | |
| document.head.appendChild(_cart); | |
| _childScript.onload = function() { | |
| //The library is loaded but not yet initialized, |
| someObject = { | |
| 0: 'example', | |
| 1: 'example', | |
| 2: 'example', | |
| returnSize: function() {//Вернуть количество позиций корзины | |
| var size = 0; | |
| for (key in this) { | |
| key = parseInt(key); | |
| if (key >= 0) { //Если клююч число то прибавить к счетчику | |
| size++; |
| $(window, document).keydown(function(event) { | |
| if (event.which == 38 || event.which == 39) { //+ | |
| event.preventDefault(); | |
| $('#shop__item-count-counter-active').next().trigger("click"); | |
| } | |
| if (event.which == 37 || event.which == 40) { //- | |
| event.preventDefault(); | |
| $('#shop__item-count-counter-active').prev().trigger("click"); | |
| } | |
| if (event.which == 13) { //положить в корзину |
| <? | |
| require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php"); | |
| $name = trim($_POST["user_name"]); | |
| $phone = trim($_POST["user_phone"]); | |
| $arEventField = array( | |
| 'USER_NAME' => $name, | |
| 'USER_PHONE' => $phone, | |
| ); |
| function setObjThemePath() { | |
| wp_register_script( 'my-script', 'myscript_url' ); | |
| wp_enqueue_script( 'my-script' ); | |
| $translation_array = array( 'url' => get_stylesheet_directory_uri() ); | |
| wp_localize_script( 'my-script', 'theme', $translation_array ); | |
| } | |
| add_action( 'wp_enqueue_scripts', 'setObjThemePath' ); |
| <section class="services"> | |
| <?$APPLICATION->IncludeComponent("bitrix:main.include","",Array( | |
| "AREA_FILE_SHOW" => "file", | |
| "AREA_FILE_SUFFIX" => "inc", | |
| "EDIT_TEMPLATE" => "", | |
| "PATH" => SITE_TEMPLATE_PATH."/includes/services/text.php" | |
| ) | |
| );?> | |
| </section> |