User Friendly : Text resize in any page

<!-- letak kod ni di mana-mana untuk paparkan link/button font size, boleh ganti dgn imej jika perlu contohnya ikon tambah dan tolak -->
<p>
<span onclick="resizeText(-1)">Smaller</span>
<span onclick="resizeText(1)">Bigger</span>
</p>

<!-- letak kod ni sebelum tutup </body> -->
<script type="text/javascript">
function resizeText(multiplier) {
  if (document.body.style.fontSize == "") {
    document.body.style.fontSize = "1.0em";
  }
  document.body.style.fontSize = parseFloat(document.body.style.fontSize) + (multiplier * 0.2) + "em";
}
</script>

Comments

  1. body {
    background-image: none;
    }

    table {
    font-family: verdana;
    font-size: 14px;
    font-weight: normal;
    text-align: center;
    color: rgb(44, 111, 83);
    width: 95%; /*setkan supaya table memenuhi ruang windows*/
    margin : 8px;
    border-collapse: collapse;
    }

    caption {
    font-size: 20px;
    font-weight: bold;
    color : rgb(44, 111, 88);
    padding : 8px;
    }

    td {
    padding: 5px;
    border: 2px solid rgb(44, 111, 96);
    }

    tr:nth-child(odd) {
    background-color: rgb(190, 222, 180);
    }

    tr:nth-child(even) {
    background-color: rgb(236, 247, 239);
    }

    tr:nth-child(1) {
    font-weight: bold;
    color:white;
    background-color: rgb(71, 198, 100);
    text-align: center;
    }

    input[type="button"] {
    font-family: verdana;
    font-size: 14px;
    text-align: center;
    margin: 5px auto;
    padding : 8px;
    }

    input[type="text"], option {
    font-size: 16px;
    font-weight: bold;
    color : rgb(44, 111, 88);
    padding : 8px;
    width: 100%;
    }

    ReplyDelete

Post a Comment