Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [HTML]Link zagnieżdżony w tekscie buttonu
Terrorizer
post
Post #1





Grupa: Zarejestrowani
Postów: 345
Pomógł: 3
Dołączył: 31.03.2012

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


Posiadam button z przypisaną funkcją pod onclick.
Chciałbym aby jedno ze słów w buttonie było linkiem, natomiast zawsze kliknięcie gdziekolwiek na buttonie daje mi onclick event.
  1. <button onclick="costam()">
  2. This is a button <a href="www.google.com"> link </a>
  3. </button>
Jest jakaś szansa na uruchomienie tego linku w jakiś sposób, czy powinienem to w ogóle przepisać inaczej (IMG:style_emoticons/default/biggrin.gif) ?

Ten post edytował Terrorizer 29.12.2014, 20:07:33
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 5)
trueblue
post
Post #2





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
Dołączył: 11.03.2014

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


http://jsfiddle.net/8tf6L0e5/2/
Go to the top of the page
+Quote Post
Terrorizer
post
Post #3





Grupa: Zarejestrowani
Postów: 345
Pomógł: 3
Dołączył: 31.03.2012

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


EDIT: Ten post nie powinien istnieć (IMG:style_emoticons/default/haha.gif)

Ten post edytował Terrorizer 29.12.2014, 20:45:22
Go to the top of the page
+Quote Post
trueblue
post
Post #4





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
Dołączył: 11.03.2014

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


Nie rozumiem. Co wcześniej nie działało, a teraz działa?
Miałeś wcześniej dołączony ten krótki skrypt w jQuery?
Go to the top of the page
+Quote Post
Terrorizer
post
Post #5





Grupa: Zarejestrowani
Postów: 345
Pomógł: 3
Dołączył: 31.03.2012

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


Przepraszam, coś mi się pokręciło.

EDIT: Niestety firefox sobie z tym nie radzi, nawet po dopisaniu jquery


Ten post edytował Terrorizer 29.12.2014, 21:26:54
Go to the top of the page
+Quote Post
trueblue
post
Post #6





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
Dołączył: 11.03.2014

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


Cytat
Chrome-approved, but silently do nothing in Firefox and IE

http://loudandabrasive.com/dont-put-links-inside-buttons/

http://jsfiddle.net/8tf6L0e5/3/
Ostyluj sobie jak chcesz span - aby przypominał systemowy lub nie.
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: 4.10.2025 - 00:13