Author Topic: Nicer Buttons for Tame JS  (Read 2674 times)

sidki3003

  • Sr. Member
  • ****
  • Posts: 476
    • ICQ Messenger -
    • AOL Instant Messenger -
    • Yahoo Instant Messenger -
    • View Profile
    • http://
    • Email
Nicer Buttons for Tame JS
« on: July 05, 2002, 04:07:00 PM »
Hi all,

Yesterday i heard about the button tag for the first time.
So this is for nicer and smaller onload/onunload buttons in Paul Rupe's Tame end.js.

Replace
------------------------
    document.writeln('<tr><td><input type=button value=' + fpropn +
                     ' onclick="' + fpropn + 'PROX();"></td>');
------------------------
by
------------------------
//    document.writeln('<tr><td><input type=button value=' + fpropn +
//                     ' onclick="' + fpropn + 'PROX();"></td>');
    document.writeln('<tr><td><button style="background-color: red; height: 18px;" onclick="' +
                     fpropn + 'PROX();"><font style="font-family: Tahoma, Verdana, Arial, serif;' +
                     ' color: gold; font-size: xx-small; font-weight: bold;">' +
                     propn + '</font></button></td>');
------------------------

And this for limiting the output string beneath the buttons to 50 chars.

Replace
------------------------
    document.writeln('<td>' + t + '</td></tr>');
------------------------
by
------------------------
//    document.writeln('<td>' + t + '</td></tr>');
    var u = '';
    for (i = 0; i < 50; i++)
    {
      u += t.charAt(i);
    }
    document.writeln('<td><font size=1 color=gray>' + u + '</font></td></tr>');
------------------------


Note: If you copy and paste the whole code you will have to restore the line breaks. Maybe copying each line is easier.

regards, sidki


 
 

Jor

  • Sr. Member
  • ****
  • Posts: 421
    • ICQ Messenger - 10401286
    • AOL Instant Messenger - jor otf
    • Yahoo Instant Messenger - jor_otf
    • View Profile
    • http://members.outpost10f.com/~jor/
    • Email
Nicer Buttons for Tame JS
« Reply #1 on: July 18, 2002, 11:43:16 AM »
Nice alterations! Taken up into my end.js