Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]onmouseover
trebron
post
Post #1





Grupa: Zarejestrowani
Postów: 32
Pomógł: 0
Dołączył: 8.11.2020

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


Witam. W globalnych ustawieniach czatu mam m.in. zdefiniowane jak ma wyglądać link z tagiem [urlMovie]
  1. $s = $text;
  2. $s = preg_replace("/\[urlMovie=([^()<>\s]+?)\]((\s|.)+?)\[\/url\]/i", "<i><b><a style='color:#00405E; font-family:Verdana; text-decoration:none;' target=_blank href=/redir.php?url=\\1>\\2</a></b></i>", $s);

Moim celem jest, aby po najechaniu kursorem na link pojawiła się tabelka plakatu z nazwą. W tym celu chcę użyć onmouseover
  1. onmouseover=\"return overlib('<table cellpadding=0 cellspacing=0 border=0 width=100%><td colspan=3 align=center style=\'font-size: 12px; font-weight:bold; background-color:#222323;\'>$name</td><tr>$poster2<td style=\'font-size:11px; font-weight:bold;\'>$opis</td></tr></table>', WIDTH, 500, DELAY, 200);\" onmouseout=\"return nd();\"

Niestety wszelkie proby dodania onmouseover do parametru replacement kończą się fiaskiem.

Ten post edytował trebron 4.12.2022, 18:52:13
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Salvation
post
Post #2





Grupa: Zarejestrowani
Postów: 406
Pomógł: 73
Dołączył: 15.07.2014

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


Nie testowałem, ale sprawdź. No i musisz ten kod JS dopisać we własnym zakresie.

  1. $s = preg_replace("/\[urlMovie=([^()<>\s]+?)\]((\s|.)+?)\[\/url\]/i", '<a class="poster" data-poster-info="true" target="_blank" href="/redir.php?url=\\1">\\2</a>', $s);

  1. a.poster {
  2. color: #00405e;
  3. font-family: Verdana;
  4. font-style: italic;
  5. font-weight: bold;
  6. text-decoration: none;
  7. }

[JAVASCRIPT] pobierz, plaintext
  1. const $posters = document.querySelectorAll('a.poster[data-poster-info="true"]');
  2.  
  3. $posters.forEach(($poster) => {
  4. $poster.addEventListener('mouseover', (event) => {
  5. // yours code
  6. });
  7. });
[JAVASCRIPT] pobierz, plaintext


Ten post edytował Salvation 8.12.2022, 13:25:23
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: 14.10.2025 - 23:06