views:

30

answers:

1

Is it possible when specifying a jQuery UI dialog box, to have an image be placed for my title instead of just plain text?

Thanks

+1  A: 

You can provide any HTML as the title option, like this:

$("#dialog").dialog({
  title: '<img src="myImage.jpg" />'
});​​​​​​​​​​​

You can see an example in action here


Or, as another demo to annoy the hell out of your users, you could do this:

$("<div />").dialog({
  title: '<marquee>Hello</marquee>'
});​
Nick Craver
Haha! Love those! Thank you so much. Any other effects such as the `<marquee>`?
BOSS
Actually, how would you recommend centering the image in the dialog title?
BOSS
@BOSS - Like this: http://jsfiddle.net/nick_craver/zCFD5/
Nick Craver
Thanks! That's perfect.
BOSS