![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 83 Pomógł: 0 Dołączył: 20.09.2007 Ostrzeżenie: (0%) ![]() ![]() |
Witam.
Mam skrypt postaci: Kod <script LANGUAGE="JavaScript"> var message="tutaj tekst"; function ButtonURL(){ window.location="test.html" } function scroll() { message = message.substring(1,message.length) + message.substring(0,1); document.bs.bs.value = message; setTimeout("scroll()",140); } window.onload=scroll document.write('<style type="text/css">') document.write('.select{color:"white";font-family:Arial,Helvetica,Verdana;font-size:10pt;font-weight: bold;}') document.write('</STYLE>') document.write('<form name=bs><INPUT class="select" TYPE="button" NAME="bs" value="" onclick="ButtonURL()"></FORM>') </script> Chciałbym ograniczyć skryptowi poszerzanie buttona, znaczy że bez względu na ilość tekstu zawsze miałby tę samą szerokość. Narazie dostosowuje button do tekstu, chce żeby szerokość była stała. |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 2 350 Pomógł: 512 Dołączył: 4.01.2009 Skąd: Wrocław / Świdnica Ostrzeżenie: (0%) ![]() ![]() |
Wystarczy dodać odrobinę CSS:
Cytat <script LANGUAGE="JavaScript"> var message="tutaj tekst 3123123 "; function ButtonURL(){ window.location="test.html" } function scroll() { message = message.substring(1,message.length) + message.substring(0,1); document.bs.bs.value = message; setTimeout("scroll()",140); } window.onload=scroll document.write('<style type="text/css">') document.write('.select{color:"white";font-family:Arial,Helvetica,Verdana;font-size:10pt;font-weight: bold; width: 50px; }') document.write('</STYLE>') document.write('<form name=bs><INPUT class="select" TYPE="button" NAME="bs" value="" onclick="ButtonURL()"></FORM>') </script> PS. Swoją drogą kod wygląda tragicznie... - szczególnie te document.write Ten post edytował kamil4u 7.03.2010, 18:19:23 |
|
|
![]() ![]() |
![]() |
Aktualny czas: 23.08.2025 - 22:57 |