473,671 Members | 2,216 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="ja vascript:SetDyn et('a=<%=a%>&am p;c=<%=x
%>&amp;l=0&amp; f=2')" onMouseUp="java script:SetDynet ('a=<%=a
%>&amp;p=88')" /></center>

Oct 8 '07 #1
1 3788
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="ja vascript:SetDyn et('a=<%=a%>&am p;c=<%=x
%>&amp;l=0&amp; f=2')" onMouseUp="java script: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='Se tDynet(...)'
onmouseup='SetD ynet(...)' />

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'sh ould 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
2463
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 onmouseup events. Everything is very simple so far. I just defined an onMouseDown event to record the event's x and y locations as the starting point, and an onMouseUp event to record the x and y of the end point, and this function gives me the...
1
1399
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 onmouseup and only such as onclick. I need to be able to submit a form when the mouse is held down on a button and submit a different form when the mouse is lifted up from the button. could anyone tell me of anything I could substitute onmousedown...
6
4736
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 "callMyFunction()" over and over again until I release the mouse button (mouseup). But what I found out the onmousedown is just acts the same as onclick. It only "callMyFunction" once. If I want to call again, I need to keep repeat mousedown, mouseup like...
3
6843
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 before the mouse button is released. In other words one element will catch onmousedown, display the popup, and the popup element will catch onmouseup. This works fine in IE as the popup automatically accepts following events, but my problem is...
9
7592
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 drop. I hope to turn on the onmouseup only in onmousedown. And eventually go one step further and incorporate onmousemove for a true drag workflow. I'm running into a problem however, where after mousedown, mouseup will not fire when I release...
5
2078
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 the boxes) the onmouseup and onmousedown events are no longer responsive. Any ideas on what happening? Thanks!
0
8472
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8390
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8909
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8819
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8667
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6222
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4221
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2806
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1801
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.