473,387 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to move a button using Javascript on MouseOver

hi,
I want to move a button to new location at the mouseOver event in JavaScript..
Please have a look at my code below.
Expand|Select|Wrap|Line Numbers
  1. function move() {
  2.    b1.style.position = "relative";
  3.    setTimeout(b1.style.left = 100,1000)
  4.    }
  5.  
  6. <input type="button" name="b1" value="click" onmouseover="move()"/>
  7.  
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
Jan 11 '12 #1
1 7870
Dormilich
8,658 Expert Mod 8TB
1) style.left expects a value with unit, e.g. 100px or 2em
2) for a movement, you need an animation. what you currently have is a single step.
Jan 11 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: clarket | last post by:
Just a quick question. Is there anyway of a JavaScript MouseOver event acting like an anchor so the mouse pointer changes as if it was an anchor. Thanks, Tony.
2
by: Joe Fallon | last post by:
I can add items to my dropdown list using javascript like this: cbo.length = j+2; cbo.options.text = "Some Text"; cbo.options.value = "MyValue"; cbo.options.text = "Some Other Text";
3
by: Daniel | last post by:
Hi all, Any ideas? your help will be appreciated. best regards, GL
5
by: | last post by:
Hi all, Has anyone been able to write some custom javascript on the onclick event of submit button to do certain things like disable submit button, only submit form once etc. This was a breeze...
2
by: Jake Barnes | last post by:
Using javascript closures to create singletons to ensure the survival of a reference to an HTML block when removeChild() may remove the last reference to the block and thus destory the block is...
4
by: Goofy | last post by:
Hi everyone, My question is related to making a form submit using javascript. Here is my scenario. I have a form, which includes a user control. The user control has a search button and a...
9
by: preetksaini | last post by:
hi, i want to know that how can i disable the close (x) button of pop window,using javascript. thanx.
1
by: vimala5 | last post by:
code for closing a window using ALT f4 or pressing cross button using javascript
5
by: ghjk | last post by:
I have "cancel" button in php files. I want to write common javascript function for cancel button. When user click cancel button I want to clear php form data. Is it possible? <input id="Cancel"...
2
by: askrk | last post by:
1.im using php programming.how to call a function using select button in form but no output has been shown........ 2.script page <script type="text/javascript"> function education_onchange() {...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.