...

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



murali1983
12-08-2006, 12:05 PM
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.

Mr J
12-08-2006, 06:49 PM
You could try something like this


<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'">

murali1983
12-10-2006, 07:20 AM
Mr J thank U soo much.., it was great help for me..

murali1983
12-10-2006, 07:40 AM
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 ?

Mr J
12-10-2006, 12:01 PM
I suppose you could try something like this example


<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>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum