Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript] Zmiana wysokości elementu na podstawie drugiego elementu
--gecior--
post
Post #1





Goście







Mam następujący kod jquery:


  1. $(function(){
  2.  
  3. $(".ksiazka_produkt:first-child").click( function() {
  4. var ksiazkaProduktHeight = $(this).height();
  5. $(this).parent().height(ksiazkaProduktHeight + 100).css("border", "1px solid red");
  6. });
  7. });


czym mogę zastąpić click(); aby rozmiar ksiazkaProduktHeight zmieniał się od razu po wczytaniu strony, a nie dopiero po kliknięciu?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
turbiński
post
Post #2





Grupa: Zarejestrowani
Postów: 23
Pomógł: 3
Dołączył: 14.10.2013

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


  1. $(document).ready(function() {
  2. var ksiazkaProduktHeight = $(".ksiazka_produkt:first-child").height();
  3. $(".ksiazka_produkt:first-child").parent().height(ksiazkaProduktHeight + 100).css("border", "1px solid red");
  4. });


Spróbuj coś takiego.
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 16.10.2025 - 12:26