hi,
I want to move a button to new location at the mouseOver event in JavaScript..
Please have a look at my code below.

function move() {
   b1.style.position = "relative";
   setTimeout(b1.style.left = 100,1000)
   }

<input type="button" name="b1" value="click" onmouseover="move()"/>

Im able to move the button to the new location but its moving very fast,I want to move the button slowly.Much like when we use .hide("slow")
I have tried using setTimeout(b1.style.left = 100,1000) but its not working..
Please guide how to do it

Member Avatar for stbuchok

are you saying you want it to be animated, to slowly move across the screen?

If so, look at using jQuery, in particular the animate method.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.