Hi,

I have a requirement after a user goes to page X which takes a while
to load, to show a spinner.   I have an issue trying to solve this
with basic JavaScript (see below).  Can prototype help here?

Details of my current problem:   It seems when I use "window.location"
as a means to redirect to the API when my longer running transaction
is does not ensure the animation for the spinner gif I have works. ie.
I see the gif ok but it not being animated. Is there another way in
Javascript to force the redirect once the gif animation starts?

<div id="loading">
</div>

<script type="text/javascript" charset="utf-8">
   function show_spinner() {
     $("form").hide()
     $("loading").show()
     window.location = "/weekends/display"   # <== SEEMS TO
STOPSPINNER ANIMATION
    }
   window.onload=show_spinner;
</script>

CSS:

#loading {
  width:100px;
  height: 100px;
  position: fixed;
  top: 50%;
  left: 50%;
  background:url(/images/ajax-loader.gif) no-repeat center #fff;
  text-align:center;
  padding:10px;
  font:normal 16px Tahoma, Geneva, sans-serif;
  # border:1px solid #666;
  margin-left: -50px;
  margin-top: -50px;
  z-index:2;
  overflow: auto;

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to