Kselax.ru

Hacker Kselax — the best hacker in the world

Menu
  • Блог
  • Контакты
  • wp plugin генератор
  • Русский
    • Русский
    • English
Menu

Рубрика: JavaScript

IOS position fixed не работает

Posted on 14 июня, 2019 by admin

На IOS устройствах position fixed не работает. Я получил задание где нужно добавить кнопкувыше клавиатуры. Кнопка прикреплена внизу. И так я сделал такой код. Показать »

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<script>
  console.log('1hello world');
  window.addEventListener('resize', () => {
    console.log('window')
  })
 
  let flag = null
  var userAgent = navigator.userAgent || navigator.vendor || window.opera;
 
  const f = () => {
    console.log('userAgent = ', userAgent);
    if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream && window.innerWidth < 800 && !flag) {
      console.log('once');
      flag = true
      
      document.getElementById('ServiceFilter_1163_MIN').addEventListener('focus', () => {console.log('focus1')
        setTimeout(() => {
          document.querySelector('.bx_filter_button_box').style.bottom="calc(50% + 10px)"
          document.querySelector('.bx_filter_button_box').style.display="block"
        },1000)
      })
 
      document.getElementById('ServiceFilter_1164_MIN').addEventListener('focus', () => {console.log('focus1')
        setTimeout(() => {
          document.querySelector('.bx_filter_button_box').style.bottom="calc(50% + 10px)"
          document.querySelector('.bx_filter_button_box').style.display="block"
        },1000)
      })
 
      document.getElementById('ServiceFilter_1163_MAX').addEventListener('focus', () => {console.log('focus1')
        setTimeout(() => {
          document.querySelector('.bx_filter_button_box').style.bottom="calc(50% + 10px)"
          document.querySelector('.bx_filter_button_box').style.display="block"
        },1000)
      })
 
      document.getElementById('ServiceFilter_1164_MAX').addEventListener('focus', () => {console.log('focus2')
        setTimeout(() => {
          document.querySelector('.bx_filter_button_box').style.bottom="calc(50% + 10px)"
          document.querySelector('.bx_filter_button_box').style.display="block"
        },1000)
      })
 
      document.getElementById('ServiceFilter_1163_MAX').addEventListener('blur', () => {console.log('focus1')
        setTimeout(() => {
          document.querySelector('.bx_filter_button_box').style.bottom="0px"
        },0)
      })
 
      document.getElementById('ServiceFilter_1164_MAX').addEventListener('blur', () => {console.log('focus2')
        setTimeout(() => {
          document.querySelector('.bx_filter_button_box').style.bottom="0px"
        },0)
      })
 
      document.getElementById('ServiceFilter_1163_MIN').addEventListener('blur', () => {console.log('focus1')
        setTimeout(() => {
          document.querySelector('.bx_filter_button_box').style.bottom="0px"
        },0)
      })
 
      document.getElementById('ServiceFilter_1164_MIN').addEventListener('blur', () => {console.log('focus2')
        setTimeout(() => {
          document.querySelector('.bx_filter_button_box').style.bottom="0px"
        },0)
      })
    }
  }
  setTimeout(() => {
    console.log('here we are');
    f()
  },0)
 
  window.addEventListener("resize", function () {
    // console.log(window.innerWidth);
    // console.log('flag = ', flag);
    console.log('userAgent = ', userAgent);
    // iOS detection from: http://stackoverflow.com/a/9039885/177"20
    
    f()
  });
</script>

И после клика на input кнопка прыгала в любое место. Она не была фиксированой. Не использую position fixed с IOS. Это не работает.   Сдесь пример того что…

Read more

Рубрики

  • C++ (293)
  • JavaScript (1)
  • linux (1)
  • MFC (39)
  • node.js (2)
  • React (3)
  • vBulletin (5)
  • Visual Studio (9)
  • wordpress (18)
  • Разное (29)

Метки

Ajax bootstrap CentOS CLI expressjs FormData GDlib google Invisible reCAPTCHA JWT media MFC php react-router-dom redux repository wordpress RTTI STL vBulletin vector Visual Studio WINAPI wordpress wp-plugins XMLHttpRequest Двоичное дерево Задачи С++ Игры С++ Исключения С++ О-большое Операторы_С++ Перегрузка операторов С++ Поиск С++ Потоки Проектирование_С++ С++ Типы_С++ Типы С++ Шаблоны С++ библиотеки локализация макросы С++ сортировка С++

Свежие комментарии

  • RA3PKJ к записи visual C++, создание диалоговых окон.
  • admin к записи Как удалить изображение из google
  • Shakanris к записи Программка для заполнения форума на vBulletin 3.8.7
  • костя к записи visual C++, создание диалоговых окон.
  • Татьяна к записи Как удалить изображение из google
©2021 Kselax.ru Theme by ThemeGiant