diff --git a/src/exemple-page.js b/src/exemple-page.js new file mode 100644 index 0000000..98c3da0 --- /dev/null +++ b/src/exemple-page.js @@ -0,0 +1,34 @@ +const firstBtn = document.getElementById('first'); +const codeFirst = document.getElementById('codeFirst'); + +const secondBtn = document.getElementById('second'); +const codeSecond = document.getElementById('codeSecond'); + +const thirdBtn = document.getElementById('third'); +const codeThird = document.getElementById('codeThird'); + +const fourthBtn = document.getElementById('fourth'); +const codeFourth = document.getElementById('codeFourth'); + +const fifthBtn = document.getElementById('fifth'); +const codeFifth = document.getElementById('codeFifth'); + +firstBtn.addEventListener('click', () => { + codeFirst.classList.toggle("active") +}) + +secondBtn.addEventListener('click', () => { + codeSecond.classList.toggle("active") +}) + +thirdBtn.addEventListener('click', () => { + codeThird.classList.toggle("active") +}) + +fourthBtn.addEventListener('click', () => { + codeFourth.classList.toggle("active") +}) + +fifthBtn.addEventListener('click', () => { + codeFifth.classList.toggle("active") +}) diff --git a/src/index.html b/src/index.html index 110e62f..bba2dec 100644 --- a/src/index.html +++ b/src/index.html @@ -34,13 +34,13 @@ - + +
               const dropdown = new DropDown({
                 selector: '.cg-dropdown_one', 
                 placeholder: 'Выберите авто', 
                 lable: 'EXAMPLE', 
-                span.code__string 
                 items: [
                   'BMW',
                   {
@@ -71,8 +71,9 @@
         
+ - +
             const dropdown = new DropDown({
               selector: '.cg-dropdown_three', 
@@ -100,8 +101,9 @@
         
+ - +
             const dropdown = new DropDown({
               selector: '.cg-dropdown_categories', 
@@ -160,7 +162,9 @@
           
         
 
-        
+        
+
+        
           
             const dropdown = new DropDown({
               selector: '.cg-dropdown_usedBtn', 
@@ -208,20 +212,20 @@
       

Функция disabled

- +
- + +
             const dropdown = new DropDown({
               selector: '.cg-dropdown_checkboxDisable', 
               placeholder: 'Выберите авто', 
               lable: 'EXAMPLE', 
-              span.code__string 
               items: [
                 'BMW',
                 {
diff --git a/src/index.js b/src/index.js
index 6b3eb2a..e956073 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,4 +1,5 @@
 import { DropDown } from './cg-dropdown';
+import './exemple-page';
 
 // ------------------------------Обычный селект--------------------
 const dropdown = new DropDown({
diff --git a/src/style/ExemplePage.scss b/src/style/ExemplePage.scss
index 21dd3ef..f1b815f 100644
--- a/src/style/ExemplePage.scss
+++ b/src/style/ExemplePage.scss
@@ -111,6 +111,10 @@
   }
 }
 
+code {
+  display: none;
+}
+
 pre {
   background: #1e1e1e;
   margin: 15px;
@@ -145,3 +149,17 @@ pre {
     color: #5090ca;
   }
 }
+
+.check-code {
+  width: 200px;
+  height: 35px;
+  cursor: pointer;
+  border: none;
+  border-radius: 10px;
+  margin: 20px 15px;
+  transition: all 1s;
+}
+
+.active {
+  display: block;
+}