Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Oct 2006
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts

    image is used as a button..,whn v click on a image v should have a feel of button.

    hi frnds,

    i am using a image in my form, on click on the image iam incrementing the table rows.. the image is small, so only if i click on middle of the image am able to increment the table rows.., so hw i can i make the user assured that he has clicked the image properly.
    So i wanted to know a method using which i can have a pushdown option to my image. like a button.

    thnx
    murali.

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    You could try something like this

    PHP Code:
    <style>
    .
    out{border:2px outset white;}
    .
    over{border:2px groove white;}
    .
    down{border:2px inset white;}
    </
    style>


    <
    img src="image.jpg" class="out" onmouseover="this.className='over'" onmouseout="this.className='out'" onmousedown="this.className='down'" onmouseup="this.className='over'"
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.

  • #3
    New Coder
    Join Date
    Oct 2006
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Mr J thank U soo much.., it was great help for me..

  • #4
    New Coder
    Join Date
    Oct 2006
    Posts
    47
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hi Mr J

    whn onmousedown function is called on a image, if i hold the mouse without releasing it for sometime then i want the rows to get increased.

    if for example i want 5 rows then instead of cliking 5 times..., if i press and hold the mouse on image then based on some frequency the rows should get increased..., is it possible ? if so can u help me ?

  • #5
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    I suppose you could try something like this example

    PHP Code:
    <script type="text/javascript">

    function 
    createObj(){

    newInput=document.createElement("INPUT")

    document.getElementById("div1").appendChild(newInput)

    timer=setTimeout("createObj()",500)
    }

    function 
    stopCreating(){
    clearTimeout(timer)
    }


    </script>

    <style> 
    .out{border:2px outset white;} 
    .over{border:2px groove white;} 
    .down{border:2px inset white;} 
    </style> 


    <img src="image.jpg" class="out" onmouseover="this.className='over'" onmouseout="this.className='out'" onmousedown="createObj() ; this.className='down'" onmouseup="stopCreating() ; this.className='over'">  


    <div id="div1"></div> 
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •