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%>&c=< %=x
%>&l=0&f=2')" onMouseUp="javascript:SetDynet('a=<%=a
%>&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