Display Drupal AJAX Trobber / Spinner persistently for styling / theming purposes

Display Drupal AJAX Trobber / Spinner persistently for styling / theming purposes

Sometimes dymanic web pages are really problematic for styling purposes.
One situation is to style an AJAX Throbber / Spinner in Drupal, which hides very fast (in most situations ;)) and is only hardly stylable though. In this blog entry I'm describing a trick to keep the AJAX Throbber visible in its position.

The throbbers HTML Code (what are we talking about)

Drupal throbbers (example in AJAX views) normaly have a HTML code like this (which may help some people in styling, if the following trick is too hard to understand for non-tech people):

  1. <div class="ajax-progress ajax-progress-throbber"><div class="throbber">&nbsp;</div></div>

Keep Drupal AJAX throbber visible via JavaScript trick

To keep the trobber visible after the first ajax request, just copy the following snippet into your browser console (Firebug e.g.) and fire it!

  1. jQuery( document ).ajaxSend(function() {
  2.  i_am_a_dummy_that_doesnt_exists();
  3. });

What it does?

The snippet simply creates a JS error, which breaks the AJAX request handling and keeps the throbber visible after starting the request.
So never use this in productive code! This is just for your local browser console ;)

Please leave a comment, if this helped you, too. =)

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.

More information about formatting options