473,322 Members | 1,778 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,322 software developers and data experts.

onmousedown onmouseup

I am flummoxed, I'm relatively new to javascript and I can't get my
onmousedown onmouseup script to work.

simply, I want to fire one function when I click down on a graphic and
a second when I release.

I tried different combinations of onmousedown onmouseup and onclick
and putting them in div's img's and anchor's but I can't get it to
work, any ideas?

<IMG SRC="down.png" alt="fade channel down"
onmousedown="javascript:SetDynet('a=<%=a%>&amp;c=< %=x
%>&amp;l=0&amp;f=2')" onMouseUp="javascript:SetDynet('a=<%=a
%>&amp;p=88')" /></center>

Oct 8 '07 #1
1 3758
NeilCarmichael wrote:
I am flummoxed, I'm relatively new to javascript and I can't get my
onmousedown onmouseup script to work.

simply, I want to fire one function when I click down on a graphic and
a second when I release.

I tried different combinations of onmousedown onmouseup and onclick
and putting them in div's img's and anchor's but I can't get it to
work, any ideas?

<IMG SRC="down.png" alt="fade channel down"
onmousedown="javascript:SetDynet('a=<%=a%>&amp;c=< %=x
%>&amp;l=0&amp;f=2')" onMouseUp="javascript:SetDynet('a=<%=a
%>&amp;p=88')" /></center>
What are the "javascript:"s doing in the values for the onmouseup and
onmousedown attributes? They aren't like the href of an <awhich
specifies a URI (and you shouldn't be using javascript: in them either
any more). The value of the onmousedown and onmouseup (and all other
onXXX) atttributes should be just javascript code.

i.e.
<img src='down.png'
onmousedown='SetDynet(...)'
onmouseup='SetDynet(...)' />

Also, if your using xhtml tagging (e.g. <img />) then you shouldn't be
also using <centerwhich is no longer strictly supported in xhtml. (a
simple <div style='text-align:center'should do the trick.

Robin
Oct 9 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: coolsti | last post by:
I am trying to let the user drag a rectangle over an image, which will then let the user zoom in on the dragged area. However, I am doing something wrong in implementing the onmousedown and...
1
by: sameth | last post by:
I wrote a script that uses onmousedown and onmouseup in javascript that works great in ie and firefox on windows2000. It looks as if the pocketpc 2003 ie browser dosn't support onmousedown or...
6
by: RC | last post by:
<a href="#" onmousedown="callMyFunction()">Press the mouse button</a> What I expect is when I or an user move mouse pointer over that link, and press the mouse button. Then will...
3
by: atn2002 | last post by:
I'm trying to create a control which when the mouse button gets pressed on one div an absolute positioned div pops up in place of the cursor. From there the cursor should interact with the dialog...
9
by: jon | last post by:
Hello, I'm trying to experiment with some javascript to do some custom dragdrop handling. I wish to use the onMouseDown event to trigger the start of my drag, and onMouseup for a potentential...
5
by: phub11 | last post by:
Hi all, I have some onmousedown and onmouseup events that dynamically insert buttons (and input text fields) into a table. However, when I click on one of the buttons (or enter text into one of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.