Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP][JavaScript] Treść dostępna po kliknięciu
Zwariowany
post 13.07.2009, 16:30:16
Post #1





Grupa: Zarejestrowani
Postów: 201
Pomógł: 0
Dołączył: 6.01.2009

Ostrzeżenie: (20%)
X----


Da się zrobić tak, że jak kliknę przycisk zaloguj to pokaże mi on formularz logowania? Czyt. czy da się zrobić tak że jak klikne link to pojawi mi się jakaś treść w jakimś miejscu? Jeśli tak, to proszę o jakieś wskazówki


--------------------
Go to the top of the page
+Quote Post
kefirek
post 13.07.2009, 16:35:00
Post #2





Grupa: Zarejestrowani
Postów: 781
Pomógł: 256
Dołączył: 29.06.2008

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


http://forum.php.pl/index.php?showtopic=99185
Go to the top of the page
+Quote Post
Zwariowany
post 13.07.2009, 16:40:01
Post #3





Grupa: Zarejestrowani
Postów: 201
Pomógł: 0
Dołączył: 6.01.2009

Ostrzeżenie: (20%)
X----


  1. <script language="javascript" type="text/javascript">
  2. function showHide(id_div,id_button){
  3. if(document.getElementById(id_div).style.display=="none"){
  4.   document.getElementById(id_div).style.display="block";
  5.   document.getElementById(id_button).value="ukryj";
  6. }else{
  7.   document.getElementById(id_div).style.display="none";
  8.   document.getElementById(id_button).value="pokaż";
  9. }
  10. }
  11. <div style="display:none;" id="jakisid">
  12. asdasd asdf sf
  13. </div>
  14. <br><br><br><input type="button" value="pokaż" onclick=javascript:showHide("jakisid","but") id="but">


Jest taka funkcja, lecz gdy próbowałem button atrybutem a href zastąpić to już nie działało ;/


--------------------
Go to the top of the page
+Quote Post
kefirek
post 13.07.2009, 16:46:11
Post #4





Grupa: Zarejestrowani
Postów: 781
Pomógł: 256
Dołączył: 29.06.2008

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


W jquery możesz to łatwo zrobić

  1. <script src="http://code.jquery.com/jquery-latest.js"></script>
  2.  
  3. $(document).ready(function(){
  4.  
  5. $("#klik").click(function () {
  6. $("#pokaz").show("slow");
  7. });
  8.  
  9. });
  10. </script>
  11.  
  12. </head>
  13.  
  14. <p id="klik">Pokaż</p>
  15. <p id="pokaz" style="display: none">to sie pojawi</p>
  16.  
  17. </body>
  18. </html>


Ten post edytował kefirek 13.07.2009, 16:46:44
Go to the top of the page
+Quote Post
Marcuez
post 13.07.2009, 19:24:55
Post #5





Grupa: Zarejestrowani
Postów: 98
Pomógł: 1
Dołączył: 7.07.2009
Skąd: Poligon Osielsko

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


Ktoś mi kiedyś powiedział że najlepsza nauka to pomoc, a więc.
Kierując sie postem poniżej.
  1. <script language="javascript" type="text/javascript">
  2. function showHide(id_div,id_button){
  3. if(document.getElementById(id_div).style.display=="none"){
  4.  document.getElementById(id_div).style.display="block";
  5.  document.getElementById(id_button).value="Ukryj logowanie";
  6. }else{
  7.  document.getElementById(id_div).style.display="none";
  8.  document.getElementById(id_button).value="Pokaż logowanie";
  9. }
  10. }
  11. <FIELDSET style="width:48%;">
  12. <input type="button" value="Pokaż logowanie" onclick=javascript:showHide("global","but") id="but">
  13. <div style="display:none;" id="global">
  14. <FORM action="#">
  15. <B>LOGIN:</B><input type="text" name="login"> <B>HASŁO:</B><input type="password" name="pass">&nbsp;&nbsp;&nbsp;<button type="submit"><b>Enter</b></button>
  16. </form>
  17. </div>


Ten post edytował Marcuez 13.07.2009, 19:33:26


--------------------
- No powiedz jak to zrobić!
- Wujek Google nie boli...
- Dziadek Marcuez mi powie :)
- -.-
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: 7.07.2025 - 05:27