Zen Follower
- Join Date:
- Aug 2005
- Posts:
- 314
- Plugin Contributions:
- 0
How to put time limit on Ajax controlled images
I'm using the Ajax Shopping Cart sidebox (the author is MIA), and there is a small image (SHOPPING_CART_AJAX_IMG_OK) which appears when putting a product in the cart.
However, the image stays indefinitely until the customer moves their mouse. In some cases, people are getting confused by this. I would like the image to timeout after a specified amount of time, regardless of mouse movement.
So, I've started looking into it enough to see there might be a simple solution for this.
I found this function:
function ajaxShoppingCart_showOk() {
if(document.getElementById("_loading_")) document.getElementById("_loading_").style.visibility = "hidden";
var imgLoading = document.getElementById("_loading_");
timerID = setTimeout( "addHandler(document, \'mousemove\', ajaxShoppingCart_hideOk)", 500);
with (imgLoading) {
src = okImage.src;
style.visibility = "visible";
}
}
I played with this line for a bit but nothing good happened:
timerID = setTimeout( "addHandler(document, \'mousemove\', ajaxShoppingCart_hideOk)", 500);
I read that the last number (500) is the amount of time but 1000 is like 1 second. Can anyone offer some knowledge on this?
Currently using ZEN CART v. 1.3.6