Jump to content

Search the Community

Showing results for tags 'onMouseDown'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 2 results

  1. Hi all, I am creating a calculator using images I have created, and am using the onmousedown and onmouseup eventsin html, to simulate 'clicking a button'. This works fine if I press the image at a moderate pace, but if i press the imagemore then once quite fast or if I double click then the image completely disappears. I have tried a number of things to fix this issue incl: timeout, sleep //written function that loops through time, calling a blankon double click, calling the mouse up from the mouse down function instead... but none of this seems to prevent the imagefrom disappearing if it has been double clicked of clicked at a fast pace. The image size is 1.37kb. Any ideas on what I am doing wrong or how I can fix this issue? Here is my html code: <td><image src="../images/keyboardnumbut7.gif" id="button15" onmousedown="mouseDown(this.id, this.src)" onmouseup="mouseUp(this.id, this.src)" onClick="numkeypressed('7')"></td> This is my javascript code: function mouseDown(id, src){var mySplitResultSrc;var mySplitResultImg; mySplitResultSrc = src.split("/");var msrs8 = mySplitResultSrc[8]; mySplitResultImg = msrs8.split(".");var imgname = mySplitResultImg[0];var imgext = mySplitResultImg[1]; document.getElementById(id).src = "../images/"+imgname+"me."+imgext;} function mouseUp(id, src){var mySplitResultSrc;var mySplitResultImg; mySplitResultSrc = src.split("/");var msrs8 = mySplitResultSrc[8]; mySplitResultImg = msrs8.split(".");var fullimgname = mySplitResultImg[0];var imgext = mySplitResultImg[1];var endpos = fullimgname.length - 2;var imgname = fullimgname.substring(0,endpos); document.getElementById(id).src = "../images/"+imgname+"."+imgext;}
  2. Is it possible to detect whether the mouse is donw and both moving or not? I've tried but no success. Please help! Thank you
×
×
  • Create New...