Forum Sementara Putera.com

Would you like to react to this message? Create an account in a few clicks or log in to continue.
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


2 posters

    javascripts button (boleh tukar)

    avatar
    sangkut
    Ahli Baharu
    Ahli Baharu


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

    javascripts button (boleh tukar) Empty javascripts button (boleh tukar)

    Post by sangkut 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
    xenomorf
    Ahli Baharu
    Ahli Baharu


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

    javascripts button (boleh tukar) Empty Re: javascripts button (boleh tukar)

    Post by xenomorf 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 Mon Nov 18, 2024 10:49 am