Drukowana wersja tematu

Kliknij tu, aby zobaczyć temat w orginalnym formacie

Forum PHP.pl _ CSS _ keyframes, powolne rozwijanie menu

Napisany przez: frankiejojo 11.05.2019, 15:02:33

Usiłuję napisać skrypt, "wyskakujące menu" tylko, że chodzi mi o to, by menu rozwijało się powoli a nie "wyskakiwało natychmiast".

Skrypt:

  1. <http://december.com/html/4/element/html.html>
  2. <http://december.com/html/4/element/head.html>
  3. <http://december.com/html/4/element/script.html src="http://code.jquery.com/jquery-2.1.1.min.js"></http://december.com/html/4/element/script.html>
  4. <http://december.com/html/4/element/script.html type="text/javascript">
  5. function menu(){
  6. $.get("search.php").done(function( data ) {
  7. $("#menuPlace").html(data);
  8. });
  9. }
  10. </http://december.com/html/4/element/script.html>
  11. <http://december.com/html/4/element/style.html>
  12. .search{
  13. color:red;
  14. animation: moveSearch 15s;
  15. }
  16.  
  17. @keyframes moveSearch {
  18. from {
  19. min-height: 0px;
  20. max-height: 0px;
  21. overflow-hidden;
  22. }
  23. to {
  24. height: 50px;
  25. }
  26. }
  27. </http://december.com/html/4/element/style.html>
  28. </http://december.com/html/4/element/head.html>
  29. <http://december.com/html/4/element/body.html>
  30. <http://december.com/html/4/element/div.html id ="menuPlace">Place</http://december.com/html/4/element/div.html>
  31. <http://december.com/html/4/element/button.html class='button buttonPanel' onclick='menu()'>Menu</http://december.com/html/4/element/button.html>
  32. </http://december.com/html/4/element/body.html>
  33. </http://december.com/html/4/element/html.html>


Plik search.php

  1. <http://december.com/html/4/element/div.html class = "search">
  2. miejscowość: <http://december.com/html/4/element/input.html type = "text" name ="city" id = "city"/></http://december.com/html/4/element/br.html>
  3. cena od: <http://december.com/html/4/element/input.html type = "text" name ="pricefrom" id = "pricefrom"/></http://december.com/html/4/element/br.html>
  4. cena do: <http://december.com/html/4/element/input.html type = "text" name ="priceto" id = "priceto"/></http://december.com/html/4/element/br.html>
  5. <http://december.com/html/4/element/button.html class='button buttonFind' onclick='find()'>Szukaj</http://december.com/html/4/element/button.html>
  6. <http://december.com/html/4/element/div.html id ="wyniki">
  7. </http://december.com/html/4/element/div.html>
  8. </http://december.com/html/4/element/div.html>


Funkcja menu uruchamia się natychmiast, nie trwa te 15 sekund.
Jakaś podpowiedź?

Napisany przez: trueblue 11.05.2019, 15:28:40

Sprawdzasz swój kod przed umieszczeniem na forum?

Nie ma właściwości overflow-hidden, jest overflow i nie jest animowalna.
Albo animujesz height, albo max-height.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)