Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [JavaScript][PHP]Pisanie po obrazku
badowl
post
Post #1





Grupa: Zarejestrowani
Postów: 62
Pomógł: 0
Dołączył: 18.07.2011

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


Witam, jestem jak napisać takie coś http://mem.kwejk.pl/mem/everywhere.html. Jest gdzieś może gotowy skrypt?
Go to the top of the page
+Quote Post
pitu
post
Post #2





Grupa: Zarejestrowani
Postów: 476
Pomógł: 96
Dołączył: 10.04.2008
Skąd: Koszalin

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


Ma to mało wspólnego z JS, zainteresuj się:
http://php.net/manual/en/book.image.php
Go to the top of the page
+Quote Post
badowl
post
Post #3





Grupa: Zarejestrowani
Postów: 62
Pomógł: 0
Dołączył: 18.07.2011

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


Wiem jak dodać tekst do obrazka, ale jakim sposobem stworzyć taki efekt jak jest na tej stronie? Chodzi mi o ten podgląd pisania
Go to the top of the page
+Quote Post
krzysiu99995
post
Post #4





Grupa: Zarejestrowani
Postów: 34
Pomógł: 0
Dołączył: 27.11.2010
Skąd: Warszawa

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


Umieść na zdjęciu jakiegoś diva i za pomocą jQuery zmieniaj jego zawartość.
Go to the top of the page
+Quote Post
Giluś
post
Post #5





Grupa: Zarejestrowani
Postów: 377
Pomógł: 9
Dołączył: 2.11.2010

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


Akurat tutaj można to zrobić tak..

W tle dać obrazek (jako background) a następnie na nim 2 divy jeden na górze a drugi na dole obrazka, obok formularz i za pomocą JS uzupełniasz obrazek..

Przykład dla rejestracji: Który sprawdza czy login jest już zajęty..

JS:
[JAVASCRIPT] pobierz, plaintext
  1. $(document).ready(function()
  2. {
  3. $("#username").change(function()
  4. {
  5. var username = $("#username").val();
  6. var msgbox = $("#status");
  7.  
  8. if(username.length > 2)
  9. {
  10. $("#status").html(' Sprawdzanie dostępności.');
  11. $.ajax({
  12. type: "POST",
  13. url: "http://aaaa.pl/ajax/register.php",
  14. data: "username="+ username,
  15. success: function(msg){
  16. $("#status").ajaxComplete(function(event, request){
  17. if(msg == 'OK')
  18. {
  19. $("#username").removeClass("red");
  20. $("#username").addClass("green");
  21. msgbox.html('<font color="Green"> Dostępny</font>');
  22. }
  23. else
  24. {
  25. $("#username").removeClass("green");
  26. $("#username").addClass("red");
  27. msgbox.html(msg);
  28. }
  29. });
  30. }
  31. });
  32.  
  33. }
  34. else
  35. {
  36. $("#username").addClass("red");
  37. $("#status").html('<font color="#cc0000">Za mało znaków</font>');
  38. }
  39. return false;
  40. });
[JAVASCRIPT] pobierz, plaintext


register.php:
  1. if(isset($_POST['useremail']))
  2. {
  3. $useremail = $_POST['useremail'];
  4. $useremail = mysql_real_escape_string($useremail);
  5. $sql = mysql_query("SELECT email FROM portal_profiles WHERE email='$useremail'");
  6. if(mysql_num_rows($sql))
  7. {
  8. echo '<span style="color: #cc0000;">Email: <strong>'.$useremail.'</strong> Zajęty.</span>';
  9. }
  10. else
  11. {
  12. echo 'OK';
  13. }
  14. }
Go to the top of the page
+Quote Post

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: 26.08.2025 - 13:21