They add the ability to set the values of the input, textarea and select fields, triggering events that can then be processed. In this way, you can link form fields with the necessary functions. For example, the dynamic calculation of the amount entered in the fields and others.
Methods
Method
Desdription
x.form.setChecked(element, checked = false)
Analog for element.checked = bool
x.form.setValue(element, value)
Analog for element.value = string
x.form.onUpdate([elements], callback)
Listen events on elements from array. [elements] — selectors array callback — callback function
x.form.update([elements], callback)
Manually dispatch update event for elements from array. [elements] — selectors array callback — callback function
John was a young man who lived in a small town. He had always dreamed of traveling the world and seeing new places. One day, he decided to pack his bags and go on a journey.
He first went to Europe, where he visited many countries. He saw the Eiffel Tower in Paris, the Coliseum in Rome, and the canals of Venice. He also tried local food and drinks, which were very delicious.
After Europe, John went to Asia. There he explored the temples of India, the Great Wall of China, and the rice fields of Japan. He learned about different cultures and religions, which made him more open-minded.
Finally, John came back home, but he knew that he would soon go on another adventure. His travels had given him a lot of new experiences and knowledge, and he was ready for more.
Opening this window, you are not closed all the other windows on the page.
Unique modal
Opening this window, you are closed all the other windows on the page.
Font size 20px
Header 2
In a faraway land, there was a beautiful sea that stretched as far as the eye could see. The sea was known for its mysterious depths and powerful waves, which had been explored by many brave sailors over the years. One day, a young man named Jack decided to set out on a journey to explore the sea and discover its secrets.
Jack had always been fascinated by the stories he had heard about the sea, and he wanted to see it for himself. He packed his bags with all the necessary supplies and set off on his journey. As he sailed across the open waters, he felt a sense of excitement and anticipation. He knew that he was about to embark on an adventure that would change his life forever.
Header 3
As he approached the sea, Jack saw how vast and majestic it was. The waves were rolling in, creating a symphony of sound that filled the air. Jack felt a deep connection to the sea, as if it were calling him to come closer. He lowered his sails and let the boat drift towards the shore.
Header 4
As he approached the sea, Jack saw how vast and majestic it was. The waves were rolling in, creating a symphony of sound that filled the air. Jack felt a deep connection to the sea, as if it were calling him to come closer. He lowered his sails and let the boat drift towards the shore.
Header 5
As he approached the sea, Jack saw how vast and majestic it was. The waves were rolling in, creating a symphony of sound that filled the air. Jack felt a deep connection to the sea, as if it were calling him to come closer. He lowered his sails and let the boat drift towards the shore.
Font size 16px
Header 2
In a faraway land, there was a beautiful sea that stretched as far as the eye could see. The sea was known for its mysterious depths and powerful waves, which had been explored by many brave sailors over the years. One day, a young man named Jack decided to set out on a journey to explore the sea and discover its secrets.
Jack had always been fascinated by the stories he had heard about the sea, and he wanted to see it for himself. He packed his bags with all the necessary supplies and set off on his journey. As he sailed across the open waters, he felt a sense of excitement and anticipation. He knew that he was about to embark on an adventure that would change his life forever.
Header 3
As he approached the sea, Jack saw how vast and majestic it was. The waves were rolling in, creating a symphony of sound that filled the air. Jack felt a deep connection to the sea, as if it were calling him to come closer. He lowered his sails and let the boat drift towards the shore.
Header 4
As he approached the sea, Jack saw how vast and majestic it was. The waves were rolling in, creating a symphony of sound that filled the air. Jack felt a deep connection to the sea, as if it were calling him to come closer. He lowered his sails and let the boat drift towards the shore.
Header 5
As he approached the sea, Jack saw how vast and majestic it was. The waves were rolling in, creating a symphony of sound that filled the air. Jack felt a deep connection to the sea, as if it were calling him to come closer. He lowered his sails and let the boat drift towards the shore.
Font size 14px
Header 2
In a faraway land, there was a beautiful sea that stretched as far as the eye could see. The sea was known for its mysterious depths and powerful waves, which had been explored by many brave sailors over the years. One day, a young man named Jack decided to set out on a journey to explore the sea and discover its secrets.
Jack had always been fascinated by the stories he had heard about the sea, and he wanted to see it for himself. He packed his bags with all the necessary supplies and set off on his journey. As he sailed across the open waters, he felt a sense of excitement and anticipation. He knew that he was about to embark on an adventure that would change his life forever.
Header 3
As he approached the sea, Jack saw how vast and majestic it was. The waves were rolling in, creating a symphony of sound that filled the air. Jack felt a deep connection to the sea, as if it were calling him to come closer. He lowered his sails and let the boat drift towards the shore.
Header 4
As he approached the sea, Jack saw how vast and majestic it was. The waves were rolling in, creating a symphony of sound that filled the air. Jack felt a deep connection to the sea, as if it were calling him to come closer. He lowered his sails and let the boat drift towards the shore.
Header 5
As he approached the sea, Jack saw how vast and majestic it was. The waves were rolling in, creating a symphony of sound that filled the air. Jack felt a deep connection to the sea, as if it were calling him to come closer. He lowered his sails and let the boat drift towards the shore.
Font size 12px
Header 2
In a faraway land, there was a beautiful sea that stretched as far as the eye could see. The sea was known for its mysterious depths and powerful waves, which had been explored by many brave sailors over the years. One day, a young man named Jack decided to set out on a journey to explore the sea and discover its secrets.
Jack had always been fascinated by the stories he had heard about the sea, and he wanted to see it for himself. He packed his bags with all the necessary supplies and set off on his journey. As he sailed across the open waters, he felt a sense of excitement and anticipation. He knew that he was about to embark on an adventure that would change his life forever.
Header 3
As he approached the sea, Jack saw how vast and majestic it was. The waves were rolling in, creating a symphony of sound that filled the air. Jack felt a deep connection to the sea, as if it were calling him to come closer. He lowered his sails and let the boat drift towards the shore.
Header 4
As he approached the sea, Jack saw how vast and majestic it was. The waves were rolling in, creating a symphony of sound that filled the air. Jack felt a deep connection to the sea, as if it were calling him to come closer. He lowered his sails and let the boat drift towards the shore.
Header 5
As he approached the sea, Jack saw how vast and majestic it was. The waves were rolling in, creating a symphony of sound that filled the air. Jack felt a deep connection to the sea, as if it were calling him to come closer. He lowered his sails and let the boat drift towards the shore.
Headers test 20px
In a faraway land, there was a beautiful sea that stretched as far as the eye could see. The sea was known for its mysterious depths and powerful waves, which had been explored by many brave sailors over the years. One day, a young man named Jack decided to set out on a journey to explore the sea and discover its secrets.
Jack had always been fascinated by the stories he had heard about the sea, and he wanted to see it for himself. He packed his bags with all the necessary supplies and set off on his journey. As he sailed across the open waters, he felt a sense of excitement and anticipation. He knew that he was about to embark on an adventure that would change his life forever.
As he approached the sea, Jack saw how vast and majestic it was. The waves were rolling in, creating a symphony of sound that filled the air. Jack felt a deep connection to the sea, as if it were calling him to come closer. He lowered his sails and let the boat drift towards the shore.
When he reached the beach, Jack stepped onto the sand and took a deep breath. The salty air filled his lungs, and he felt alive. He looked up at the sky and saw the sun shining brightly above him. It was a perfect day to begin his exploration.
Headers test 16px
In a faraway land, there was a beautiful sea that stretched as far as the eye could see. The sea was known for its mysterious depths and powerful waves, which had been explored by many brave sailors over the years. One day, a young man named Jack decided to set out on a journey to explore the sea and discover its secrets.
Jack had always been fascinated by the stories he had heard about the sea, and he wanted to see it for himself. He packed his bags with all the necessary supplies and set off on his journey. As he sailed across the open waters, he felt a sense of excitement and anticipation. He knew that he was about to embark on an adventure that would change his life forever.
As he approached the sea, Jack saw how vast and majestic it was. The waves were rolling in, creating a symphony of sound that filled the air. Jack felt a deep connection to the sea, as if it were calling him to come closer. He lowered his sails and let the boat drift towards the shore.
When he reached the beach, Jack stepped onto the sand and took a deep breath. The salty air filled his lungs, and he felt alive. He looked up at the sky and saw the sun shining brightly above him. It was a perfect day to begin his exploration.
Headers test 14px
In a faraway land, there was a beautiful sea that stretched as far as the eye could see. The sea was known for its mysterious depths and powerful waves, which had been explored by many brave sailors over the years. One day, a young man named Jack decided to set out on a journey to explore the sea and discover its secrets.
Jack had always been fascinated by the stories he had heard about the sea, and he wanted to see it for himself. He packed his bags with all the necessary supplies and set off on his journey. As he sailed across the open waters, he felt a sense of excitement and anticipation. He knew that he was about to embark on an adventure that would change his life forever.
As he approached the sea, Jack saw how vast and majestic it was. The waves were rolling in, creating a symphony of sound that filled the air. Jack felt a deep connection to the sea, as if it were calling him to come closer. He lowered his sails and let the boat drift towards the shore.
When he reached the beach, Jack stepped onto the sand and took a deep breath. The salty air filled his lungs, and he felt alive. He looked up at the sky and saw the sun shining brightly above him. It was a perfect day to begin his exploration.
Headers test 12px
In a faraway land, there was a beautiful sea that stretched as far as the eye could see. The sea was known for its mysterious depths and powerful waves, which had been explored by many brave sailors over the years. One day, a young man named Jack decided to set out on a journey to explore the sea and discover its secrets.
Jack had always been fascinated by the stories he had heard about the sea, and he wanted to see it for himself. He packed his bags with all the necessary supplies and set off on his journey. As he sailed across the open waters, he felt a sense of excitement and anticipation. He knew that he was about to embark on an adventure that would change his life forever.
As he approached the sea, Jack saw how vast and majestic it was. The waves were rolling in, creating a symphony of sound that filled the air. Jack felt a deep connection to the sea, as if it were calling him to come closer. He lowered his sails and let the boat drift towards the shore.
When he reached the beach, Jack stepped onto the sand and took a deep breath. The salty air filled his lungs, and he felt alive. He looked up at the sky and saw the sun shining brightly above him. It was a perfect day to begin his exploration.
The Sea: A Story of Adventure and Discovery
In a faraway land, there was a beautiful sea that stretched as far as the eye could see. The sea was known for its mysterious depths and powerful waves, which had been explored by many brave sailors over the years. One day, a young man named Jack decided to set out on a journey to explore the sea and discover its secrets.
Jack had always been fascinated by the stories he had heard about the sea, and he wanted to see it for himself. He packed his bags with all the necessary supplies and set off on his journey. As he sailed across the open waters, he felt a sense of excitement and anticipation. He knew that he was about to embark on an adventure that would change his life forever.
As he approached the sea, Jack saw how vast and majestic it was. The waves were rolling in, creating a symphony of sound that filled the air. Jack felt a deep connection to the sea, as if it were calling him to come closer. He lowered his sails and let the boat drift towards the shore.
When he reached the beach, Jack stepped onto the sand and took a deep breath. The salty air filled his lungs, and he felt alive. He looked up at the sky and saw the sun shining brightly above him. It was a perfect day to begin his exploration.
Jack began walking along the shore, taking in the beauty of the sea. He watched the waves crashing against the rocks, creating a spray of water that shimmered in the sunlight. He listened to the seagulls flying overhead, their cries echoing across the horizon.
Ivan backloop
After walking for some time, Jack came upon a small fishing village. The villagers were friendly and welcoming, and they invited Jack to stay for a while. Jack accepted their offer and spent several days learning about their way of life. He helped them with their fishing and learned about the local customs and traditions.
One day, while sitting on the dock, Jack noticed something strange in the distance. There was a dark cloud on the horizon, moving towards them. The villagers became worried, and Jack realized that a storm was approaching.
The storm hit the village with full force, bringing strong winds and heavy rain. Jack huddled in a corner, trying to stay dry. When the storm finally passed, Jack emerged from his hiding place and looked around.
Jack began walking along the shore, taking in the beauty of the sea. He watched the waves crashing against the rocks, creating a spray of water that shimmered in the sunlight. He listened to the seagulls flying overhead, their cries echoing across the horizon.
Waves
The waves were always there, crashing against the shore. They were a constant reminder of the power and beauty of nature. The waves came in all shapes and sizes, from gentle ripples to towering breakers.
Some people feared the waves, seeing them as a threat. But others saw them as something to be admired and respected. The waves could be calm and peaceful, or they could be wild and unpredictable.
One day, I decided to go to the beach and watch the waves. I sat on the sand and watched as they rolled in, one after another. I listened to their rhythmic sound and felt the spray of water on my face.
I watched as the sun set over the horizon, casting a golden glow over the waves. It was a beautiful sight, and I knew that I would never forget it.
As I walked back home, I thought about the waves and what they meant to me. They were more than just water moving up and down. They were symbols of life's ups and downs, of its beauty and its power.
Once I saw a little bird outside my window. It was chirping happily and looking for food. I put some seeds on the windowsill, and it ate them right away.
Once I saw a ship on the sea. It was sailing smoothly and leaving a trail in the water. The sun was setting, making the scene even more beautiful.
Once I saw a little bird outside my window. It was chirping happily and looking for food. I put some seeds on the windowsill, and it ate them right away.
Once I saw a ship on the sea. It was sailing smoothly and leaving a trail in the water. The sun was setting, making the scene even more beautiful.
.icon - icon with default size 1em
.icon_[10-60] step 2 (m,l) - modifier with size in px
Colors
.colorPrimary.colorSuccess.colorWarning.colorDanger.bgPrimary.bgSuccess.bgWarning.bgDanger.bgGrey
.color[ColorName] (d) - text color
.bg[ColorName] (d) — background color
[custom-classes] — классы, которые будут добавлены элементу .modal после генерации модального окна на основе шаблона. [modal-window-classes] — классы, которые будут добавлены элементу .modal-window после генерации модального окна на основе шаблона. .uniq — класс, закрывающий все открытые окна при открытии данного окна, добавляется в [custom-classes]. .hash — если класс добавлен в [custom-classes], окна, открываясь, будут добавлять хэш в конец адресной строки. Также при загрузке страницы с хэшем модального окна, оно автоматически будет открываться.
После инициализации, шаблон модального окна преобразуется в готовый код, который добавляется в конце страницы перед </body>. Если это поведение необходимо изменить, добавьте класс .modal-here элементу, в который вы хотите инициализировать модальные окна.
Код инициализированного модального окна:
<div id="myModal" class="modal [custom-classes]"> <div class="modal-overlay"></div> <div class="modal-outer"> <div class="modal-inner"> <div class="modal-window [modal-window-classes]"> ... Содержимое, которое было внутри тега с классом .modal-content ... <div class="modal-rail"> <a role="button" class="modal-close"></a> </div> </div> </div> </div></div>
The element selector, whose position we are tracking when scrolling. If there is no trigger, the trigger is the animated element itself.
start
string
The starting point of the animation (the distance from the top of the window in px, vh or %). Required
end
string
Animation end point (distance from the top of the window in px, vh or %). Required
functionName
string
The name of the global function that is performed when the tracked element is moved between the start and end points of the animation. The function receives an object with the progress parameter, which varies from 0 to 1. Required
class
string
A class that is added to an animated element when it is in the process of being animated.
classRemove
bool = false
To delete or not the class set by the previous parameter after the end of the animation.
If the animation is performed in a separate scrollable element, you need to add the .animate-scrollarea class to this element.
Загрузка данных при прокрутке до элемента. Можно использовать как бесконечную прокрутку, добавив элемент в конце списка и подгружая в него данные, по мере его появления.
При появлении блока с data-loadmore в границах экрана, будет выполнена функция, имя который указано в functionName. Функции будет передан параметр page, значение которого увеличивается с каждым вызовом.
Остановить выполнение функции можно методом:
x.loadmore.unwatch()
Параметры вызова
Параметр
Формат
По умолчанию
Описание
functionName
string
Имя функции, которую нужно выполнить. Обязательный
offset
int
0
Смещение выполнения за границу экрана. Например, если указать 100, то функция выполнится, когда до появления элемента на экране останется 100 и менее пикселей.
Если анимация производится в отдельном прокручиваемом элементе, нужно добавить этому элементу класс .animate-scrollarea.
Lazyload
Отложенная загрузка изображений.
В настоящее время большинство браузеров поддерживает нативную «ленивую загрузку» loading="lazy", используйте данный плагин только в случае крайней необходимости. Например, иногда нужно отследить загрузилось ли изображение.
После загрузки изображения с классом .lazyload, к нему добавится класс .loaded.
Appear
Добавляет классы .appeared и .visible на элементе, появившемся в зоне видимости.
Пример использования:
<div x-appear>...</div>
Когда элемент появится в зоне видимости, к нему добавятся 2 класса, .appeared и .visible. Класс .appeared останется навсегда, а класс .visible удалится при исчезновении элемента из зоны видимости.
Hover
Синхронизирует наведение .hover у отдельно расположенных элементов, имеющих общую ссылку. Для активации элементам нужно добавить класс .syncHover.
В данном примере при наведении на фото или название товара, обоим элементам <a> добавится класс .hover, так как у них одинаковая ссылка. Данный метод часто позволяет избежать нарушений в семантике, не оборачивая весь блок в тег <a>.
Device
Определяет устройство и браузер пользователя.
Использование:
if (x.device.[name]) { ... }
name — значения для проверки.
Браузеры: ie, firefox, safari, webkit, chrome, opera
ОС и устройства: windows, macos, linux, ios, ipad, ipod, iphone, android
Мобильность: mobile, desktop
Поддержка js: js
Последовательное переключение классов. Иногда удобно использовать, когда требуется задержка, пока не завершится анимация. По очереди запускает addClass и removeClass.
x.lib.makePassword(length, selector)
Создает пароль указанной длины (по умолчанию — 8).
Если созданный пароль сразу нужно вставить в поле input или textarea, вы можете указать выражение для querySelector этого поля в переменной selector.
Отложенное выполнение кода. Анонимная функция с кодом () => { code } будет запущена через время delay (по умолчанию 10 с), либо по наступлении одного из событий: scroll, resize, click, keydown, mouseover, touchmove.
Пример:
x.lib.deffered( () => { Code... }, 10000)
x.lib.runOnAppear(selector, callback, options)
Выполнение кода при его появлении во Viewport (по умолчанию ближе чем за 100px за Viewport). Анонимная функция с кодом () => { code } будет запущена при приближении указанного блока к Viewport.
Пример:
x.lib.runOnAppear( '.css_selector', () => { Code... }, options (не обязательно))
x.lib.isEmail(email)
Определяет валидность адреса электропочты.
x.lib.alertErrors(data)
Показывает алерт с ошибками. data — объект (ключ: значение), массив или строка.
Каждая ошибка будет выведена с новой строки (разделены \n).
x.lib.printErrors(data)
Печатает ошибки. data — объект (ключ: значение), массив или строка.
Каждая ошибка будет выведена с новой строки (разделены <br/>).
async render(selector, data, placement = null)
[x-render] | Render JavaScript in 'x-render' attribute