Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [JavaScript]przepisanie skrytptu na czysty JS
stellatus
post 7.01.2020, 19:02:59
Post #1





Grupa: Zarejestrowani
Postów: 196
Pomógł: 0
Dołączył: 9.03.2017

Ostrzeżenie: (0%)
-----


W nawiązaniu do: http://forum.php.pl/index.php?showtopic=26...p;#entry1248646
Codepen: https://codepen.io/rudolph-reti/pen/OJPzPqw

Czy da się to przepisać tak, żeby było w czystym JS bez jQuerry?

Ten post edytował stellatus 7.01.2020, 19:03:49
Go to the top of the page
+Quote Post
trueblue
post 7.01.2020, 19:25:03
Post #2





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
Dołączył: 11.03.2014

Ostrzeżenie: (0%)
-----


https://stackoverflow.com/a/10186368



--------------------
Go to the top of the page
+Quote Post
stellatus
post 7.01.2020, 19:41:00
Post #3





Grupa: Zarejestrowani
Postów: 196
Pomógł: 0
Dołączył: 9.03.2017

Ostrzeżenie: (0%)
-----


Dzięki. Przepraszam, ale to nie jest jeszcze mój poziom. Nie jestem w stanie znaleźć tam odpowiedzi na swoje pytanie. Mógłbyś proszę jakoś bardziej "łopatologicznie"?

Ten post edytował stellatus 7.01.2020, 19:42:58
Go to the top of the page
+Quote Post
trueblue
post 7.01.2020, 19:52:47
Post #4





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
Dołączył: 11.03.2014

Ostrzeżenie: (0%)
-----


  1. b = b.innerText.trim().toLowerCase();
  2. a = a.innerText.trim().toLowerCase();

  1. function finallListSort() {
  2. let list = document.querySelectorAll('ul li');
  3. list = Array.prototype.slice.call(list);
  4. list.sort(letterSort);
  5.  
  6. for (var i = 0; i < list.length; i++) {
  7. list[i].parentNode.appendChild(list[i]);
  8. }
  9. };

Reszta bez zmian.


--------------------
Go to the top of the page
+Quote Post
stellatus
post 7.01.2020, 20:09:04
Post #5





Grupa: Zarejestrowani
Postów: 196
Pomógł: 0
Dołączył: 9.03.2017

Ostrzeżenie: (0%)
-----


Mistrz! Dzięki bardzo!

Ten post edytował stellatus 7.01.2020, 20:12:45
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 18.07.2025 - 01:24