Forum Sementara Putera.com

Bersama kita perkemaskan forum ini sementara forum asal dalam pemulihan.

Forum putera dah kembali. Masalah sudah berjaya diselesaikan. Sila lawati http://forum.putera.com/tanya


    javascripts button (boleh tukar)

    Share

    sangkut
    Ahli Baharu
    Ahli Baharu

    Number of posts : 124
    Registration date : 26/07/2009

    javascripts button (boleh tukar)

    Post by sangkut on Thu Dec 17, 2009 5:02 pm

    nei code biase (buutton gif) :

    Code:
    <input type="image" src="whatever.gif"
          onclick="document.getElementById('input').select(); return false; "/>

    mcm mana nk tukar button image jikalau mouse sentuh button gambar pertama..

    contoh :

    http://www.webdevelopersnotes.com/tips/html/using_an_image_as_a_submit_button.php3

    ------------------------------------------

    tapi ak tak tau nak masuk kan code yg kat contoh tu pada code ini :

    Code:
    <input type="image" src="whatever.gif"
          onclick="document.getElementById('input').select(); return false; "/>

    xenomorf
    Ahli Baharu
    Ahli Baharu

    Number of posts : 239
    Location : BehinD ThE WaLL
    Registration date : 26/03/2009

    Re: javascripts button (boleh tukar)

    Post by xenomorf on Mon Dec 21, 2009 10:02 am

    gn tag onMouseOver dgn onMouseOut

    Code:

    onmouseover="document.NAMA_FORM.NAMA_IMAGE..src='tempat button kedua'"
    onmouseout="document.NAMA_FORM.src='tempat button pertama'"

    jd code ko akn jd cmni >>
    Code:

    <input type="image" src="button_pertama.gif"
    onmouseover="document.NAMA_FORM.NAMA_IMAGE.src='tempat button kedua'"
    onmouseout="document.NAMA_FORM.NAMA_IMAGE.src='tempat button pertama'"
          onclick="document.getElementById('input').select(); return false; "
    name="NAMA_IMAGE" />

    tp klu yg kat atas kena ada tag <form> ... </form>

    klu x ada tag tu, isi cmni ja
    Code:

    <input type="image" src="button_pertama.gif"
    onmouseover="document.NAMA_IMAGE.src='tempat button kedua'"
    onmouseout="document.NAMA_IMAGE.src='tempat button pertama'"
          onclick="document.getElementById('input').select(); return false; "
    name="NAMA_IMAGE" />

    yg penting tag name="NAMA_IMAGE" tu.

      Current date/time is Sat Dec 10, 2016 7:09 am