Basically, the phenomenon I'm seeing is a change in how often the onmousemove is triggered. My site has 1 up to n (n can really be any number) of moveable, resizable divs, each with dynamic content, but I noticed that on various browsers, the moving/resizing displays phenomenal performance differs. On Firefox -- it's as real time as it should get and I'm happy with it, but in IE, Safari, and Opera (I have not tested this under Linux or MacOS) things are much slower.
Anyway, after hours and hours of optimization, it occurred to me to begin capturing the mouse coordinates in realtime in the content of one of the windows. In other words, whenever I move the mouse anywhere on the page, it's coordinates are returned by window.event.clientX/Y or event.pageX/Y appear in one of the 1 to n windows.
To my surprise, the rate at which those numbers changed only stayed constant under Mozilla. But on each of the other browsers (Safari by far the worst) depending somewhat on how many boxes were displayed on the screen and where on the screen I moved the mouse, the coordinates that displayed in the box updated only with every 10 -- even 100 pixel movement causing seriously choppy movement.
I'm sure without demonstration this is not coming across clearly, but if anyone has any insight into how the onmousemove timing works, I'd appreciate it.
My site is similar to Meebo -- and if you'll notice, dragging their objects stays relatively smooth across all browsers, and I simply can't get the onmousemove timing to not be choppy -- I've put it in <body> as well as in a <div w:100% h:100% that covers the entire background>.
I do have a fair amount of transparency which could of course cause some CPU intensity, but I don't see how Firefox would be that much more optimized (the performance difference is phenomenal). My system is a dual 2.8 Ghz Xeon with 1GB ram -- neither is being maxed out.
My theory is that somehow there is a "setInterval" equivalent built into the event object that is variable but only controllable by the browsers.
I have an ajax post which returns a large html response. It is getting truncated at 98784 characters everytime. Is there a limit to a response size or a way around this?
I put an onMouseOver and an onMouseOut event on a div. The onMouseOver works well but the onMouseOut looks worked like an onMouseMove; the event is triggered when a move the mouse over the div.
is it normal? What should I do to avoid this problem?
I am new to JavaScript and kind of confused as to why my onmousedown together with onmousemove condition is not being implemented. Here is what I have: 1) SVG code calling JavaScript function
function doZoom(evt, current) { //THIS SHOULD WORK if (evt.type == "mousedown" && evt.type == "mousemove" ) { var SVGDoc = evt.getTarget().getOwnerDocument(); var SVGChild = SVGDoc.getElementById("maps"); var svgobj = SVGChild.getElementById("0"); svgobj.getStyle().setProperty('display', 'none'); } }
But the code works only if I say: 'if (evt.type == "mousedown") without "mousemove" . Please note, that I am calling my function onmousemove event also so it should register. I will very much appreciate if somebody could tell me why 'mousemove' AND 'mousedown' both don't work in my 'If' statement.
I am currently trying to write some javascript that detects mouse movement in some way or another. This is for a website vistitor tracking script i am writing. The purpose would be to detect if the vistor is human or robot. Right now myfunction() grabs the info and inserts it into our database if any mouse movement is detected. But the script executes every time the mouse moves on the same page. So we are getting multiple log entries when we only want one.
So my question is this: Is there a way to once javascript has detected mousemovemnt once, to not detect it again? here is my code document.onmousemove = function() { myfunction();} I am not all too familliar with javascript and will probably need written out examples to grasp this.
My functions for mouse_move / up / down all control the movement of a box. So you can click a box and move it anyway. It then snaps to an invisible grid. However there are multiple boxes on the screen so if you move it to a spot where another box already resides, then that box needs to swap places.This is what the mouse_over function tries to do. When I click the first box it stores the position of that box that was clicked. If I release the mouse button whilst hoovering over another box I want the other box to take the stored positions of the first box.However what I think is happening is the mouseover function is applying the new position to the box I'm moving, as I guess this is the first layer the mouse is over.Is there anyway I can reference the layer underneath using onmouseover.
In IE6, putting the mouse on each of the two items highlights the word in a blue (different image) and shows a tool tip. In Firefox(1.5.0.6), nothing shows when mouse goes over it. Please view the source of that simple page (with some JavaScript) to see if you know how I can get this to look in Firefox like it does in IE?
I'm writing a JavaScript Equation Editor / Whiteboard App, and i seem to be having a problem with one line of JavaScipt Code.... The Equation Editor is hosted live here:[URL] I have used the DOM Inspector (i'm using firefox) to look at the onMouseDown= event code, and it should work.... However, when i try to drag a Math Element Image to a different location (after it has been added to the page by clicking on the Math Element Keyboard), it does nothing. I looked on the Error Console, and there is nothing there.
I looked at the Node value in the DOM inspector, and it is as it should be. I have also tried changing and removing some double quotes and single quotes, as that has worked in the past on similar code snippets.
What's wrong with this code? It works in IE and FireFox, but Chrome does not work. The idea is that the function fnTimeOut will be triggered in 5 seconds after onmousemove (fnTimeOut was attach in onmousemove in document). It�s ok. But when, in Chrome, I click on the button "ok" to function fnAlert is triggered instantly. It should be shot just 5 seconds after I move the mouse
can someone explain how i can use an ondblclick event to cancel an onmousemove event? would I use cancelBubble for this? i have a statement in my header document.onmousemove = updateMouseCoordinates; that moves a sentence of text around the screen. when i try to call a function using ondblclick event in the <p> tag, it fails to call function. without statement above, the function is called.... my purpose is to just cancel the onmousemove in event user performs a double click.
I use an HttpRequest in my web application to launch an heavy computation server side. The result is then send back to the browser. The problem I got is that when the computation took too much time, then I never get the result. I have to reload the page to get it.
I assume it's because my socket connection has time out, but my event listener does not seems to get any event. Maybe I miss something:
function xmlhttpChange() { // looking fo a xmlhttp "loaded" for (var i in nodeId2xmlHttp) { if ((nodeId2xmlHttp[i] != null) && nodeId2xmlHttp[i].readyState == 4) { if (nodeId2xmlHttp[i].status==200) { nodeId2xmlHttp[i] = null; } else { alert("Problem retrieving XML data (nodeId: " + i + ")"); nodeId2xmlHttp[i] = null; } } } }
My question is : how to handle XMLHttpRequest timeout. Any pointers?
I'm trying to decrease my numeric variable in random increments from 0-4 every 5 seconds until this variable reaches 0. Basically it's a countdown, but has a random increment each count. Here's my code:
I want to set textbox timeout. If not complete insert data to textbox in 5 sec, textbox will empty. If complete insert data to textbox ( insert 15 charectors ), it will use data in textbox to other function. How did I do?
Got this idea in my head Is it doable to refresh a iframe embeded in a page after X time if the iframe page timeouts. I have a home made blaber box a.k.a shoutbox and it refreshes every 5 seconds from within the iframe.
All is well untill a connection reset or timeout happens as then the user has to refresh the page or click on the page links Is there something that can be called to repeat untill the page returns a 200 status or something rather then a timeout or can not be found?
I would like to know if it's possible to force a dialog box to "expire" after so many seconds? The scenario is that I'm holding various objects in my session. Before it times out, I want to notify the user to click Okay to save the work now OR click cancel to refresh the page. What if the user doesn't respond to the dialog box for a long time and then hits save? Well the session has already timed out!
So, can I have the dialog box appear until the session times out and then force a refresh without user interaction? I've seen a similar thing done before on bankOfamerica website, but I'm not sure if it's with Javascript.
Now, I am having one problem with the .ajax() function. My problem is, the timeout value seems to be completely ignored. [code]...
The idea is that when the underlying hardware is restarted (this is a control page for a device), we should time out very quickly, rather than locking the browser. I have stepped though with a debugger, and the 250ms value is definitely being inserted when the reboot command is issued. Any idea why this is not working?
function asd() { var timeout = setInterval('alert('asd')', 3000); } function asd2() { // with this function I want to remove the interval of 3 seconds for variable timeout. }
I have variable timeout and with the second function asd2() I want to remove this variable.
$('#nav li a').click(function(e) { e.preventDefault(); $('#nav li a').removeClass('on');
[code]....
I need to do this, in addition to .click-binding, automatically; i.e., if no user-action by 15 secs I need this content-switching to start happening automatically; and also give 5 secs or so for the next div to show up (and hide div currently visible); how do I do this? like a slideshow, in other words, but switching divs (and doing the classes for the thumbnails)
iam developing online quiz contest project in php (mysql,javascript,ajax) i need Automatic session timeout/logout and also i need time counter display using php and AJAX.
I want to call a function through a property of an object indefinite times, so i want to be able to pass a value to some other property (inc for example), with the number of times that function was called (gen). If it's not the first time it's called i want to cause a delay ( 5sec for example).I'm currently doing it with a setTimeout but it isn't for sure them most elegant way to do it.
I have what I think is a simple $.ajax() call.I added complete and error functions but a time out in firefox 3.5.2 doesn't cause the error function to be called and when the complete function is called both parameters are undefined.If I make the ajax call return a http 500 response the error function is called.[code]Running on FF 3.5.2, JQuery 1.6.2 on XP Pro.