Forums / Addon Sideboxes / How to put time limit on Ajax controlled images

How to put time limit on Ajax controlled images

Locked

Started by magicpants on 31 Oct 2006, 2:48 AM · Views: 2,382

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
31 Oct 2006, 2:48 AM
#1
magicpants avatar

magicpants

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

4 Nov 2006, 4:52 AM
#2
a_berezin avatar

a_berezin

Deceased

Join Date:
Aug 2004
Location:
Saint Petersburg, Russia
Posts:
1,782
Plugin Contributions:
5

Re: How to put time limit on Ajax controlled images

magicpants:

I'm using the Ajax Shopping Cart sidebox (the author is MIA),Really? Nice news! Where I can get this "Ajax Shopping Cart" from MIA?

NOTE: We are sorry that Andrew is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

29 Jan 2007, 10:13 PM
#3
magicpants avatar

magicpants

Zen Follower

Join Date:
Aug 2005
Posts:
314
Plugin Contributions:
0

Re: How to put time limit on Ajax controlled images

Hehehe... I was talking about YOUR module, a_berezin! MIA = missing in action. I hadn't gotten a response for a while so I thought you were gone from the site. Actually, I went MIA from this thread! Ironic.

Anyway, your module works great for us -- except this problem: the SHOPPING_CART_AJAX_IMG_OK image doesn't disappear until the customer moves their mouse. Is there a way to add a timeout so it disappears even if the mouse doesn't move?

I haven't seen much talk about this mod you made in the past, but I love it! I don't know why it was dropped, we get so much positive feedback about it from customers.

MP

Currently using ZEN CART v. 1.3.6