I'm not sure what's causing the slowness, and it's still usable. Regardless, I'd like to figure it out to make this a bit more user-friendly. Any ideas?

capoeiradecatur.com/node/2933

Comments

overbythere’s picture

The way the price is updated is (as far as I am aware) is a AJAX call, meaning behind the scenes your web browser is loading a webpage, and getting the value back from this webpage, so it depends on the speed of your internet connection/server.

Ways to get around this:

  • You may be able to change it to update from the select menu (explode the string, and pull out the value maybe)
  • Update your server/internet connection
  • You might be able to (or the owner of this module may be able to) make the price show as 'loading price...' before the new price appears

I hope this makes sense, and helps answer your question about it being slower.

Regards,

-Dan, Attitude Design.

Rocinant’s picture

I would think that a 'wait cursor' might be a good alternative to the 'loading price' suggestion of Dan.
It must be possible with a script on the page that looks something like this (as written on http://postpostmodern.com/instructional/global-ajax-cursor-change):

drupal_add_js (
    function globalAjaxCursorChange()   
    {  
      $("html").bind("ajaxStart", function(){  
         $(this).addClass('busy');  
       }).bind("ajaxStop", function(){  
         $(this).removeClass('busy');  
       });
    )  
}  

Combined with this code in the css-file

html.busy, html.busy * {
cursor: wait !important;
}

But this code does not yet work, as my knowledge of jQuery and Javascript is not that good...
Is anyone able to correct the syntax?

Regards
Rocinant

vin247’s picture

I got this working using the following:

<script type="text/javascript">
$('html').ajaxStart(function(){
  $(this).addClass('wait').bind('click',function(){
    return false;
  });
}).ajaxStop(function(){
  $(this).removeClass('wait').unbind('click');
});
</script>

and the css:

html.wait, html.wait * {cursor:progress;}

kris_mcl’s picture

That works perfectly, thanks for posting that vin247!

splash112’s picture

Very nice addition indeed!

splash112’s picture

Issue summary: View changes

Somehow it stopped working for me (or I should say, continued to spin without ever stopping for some browsers).