jQuery BlockUI Plugin method blockUI how to display just image without any background

Viewed 29634

Here is on the sample page http://jquery.malsup.com/block/ is an example of an overlay message with an image:

$.blockUI({ message: '<h1><img src="busy.gif" /> Just a moment...</h1>' });

But I want to display just an image, so I took out the h1 tag:

$.blockUI({ message: '<img src="busy.gif" />' });

But there is still a background color under my image. How can I remove it?

According with source code of jQuery BlockUI Plugin (v2) it is wrapping the message in an h2 tag

if (title) $m.append('<h1>'+title+'</h1>');
if (message) $m.append('<h2>'+message+'</h2>');

so it looks like there is no way without modification of the source code to pass just an image tag.

I might modify the library source code to introduce a new param like image with a condition:

if (image) $m.append(image);

and than I could declare my image like this:

$.blockUI({ image: '<img src="busy.gif" />' });

Any more ideas?

5 Answers
Related