jQuery UI - change CSS background image -> .ui-widget-header

I use a theme that I would like to switch the header background image to a different image color which I have. The image is

url(images/ui-bg_gloss-wave_45_e14f1c_500x100.png)

Open in new window


Can you point out where in the following code I would insert it. This is the dialog. I know how to change it for ALL the dialog, - I can go in the CSS stylesheet. But I need it dynamic.

$("#dialog-DeleteFaveNoChoice").dialog({ 
			width:400,
			height:120,
			autoOpen: false,
			modal: true
		});
$("#dialog-DeleteFave").dialog({ 
			html: "<p>test</p>",
			buttons: [{ 
				text : _yes, 
				click :function() {
						var FaveToDelete = $("select[name=selectFavorite]").val();	
						var ViewBasedOn = $("#ViewBasedOnSelect").val().split("_",3);
						$.ajax({
						   type: "POST",
						   url: "/aaMain/ajaxFavoriteDelete.php?datagroup="+ViewBasedOn[2]+"&FaveToDelete="+FaveToDelete,
						   //data: $("form[name=filters]").serialize(),
						   success: function(msg){	document.filters.runButton.value=1;
	 									document.filters.submit();
							  }
						});
					
						// then close

						$(this).dialog("close");}
					},
					{ 
				text : _no,
				click: function() {
						
		
						$(this).dialog("close");} 
					}]
			,
			width:500,
			autoOpen: false,
			modal: true,
			open: function() {
				var container = $("#dialog-DeleteFave").parent();
				$(".ui-button-text:contains('" + _no + "')", container).parent("button.ui-button").focus();
				$(".ui-button-text:contains('" + _yes + "')", container).parent("button.ui-button").blur();
				
			}
			
		});
		$( "#deleteFave" )
					.click(function() {
						var FaveToDelete = $("select[name=selectFavorite]").val();	
						if(FaveToDelete==""){
						//alert(_warningFavNoChoice);
						
						$("#dialog-DeleteFaveNoChoice").html(strIcon+" "+_warningFavNoChoice).dialog('open');
						}
						else{
							var FaveToDeleteText = $("select[name=selectFavorite]>option:selected").text();
							$("#dialog-DeleteFave>p").html(strIcon + _warningRemove + " " + "<b>"+ FaveToDeleteText +"</b>" + " ?");
							$( "#dialog-DeleteFave" ).dialog( "open" );
						}
			});

Open in new window


gbeaulacAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RobOwner (Aidellio)Commented:
In the open function you can try and access the class directly and change its settings:



$('.ui-dialog-titlebar').css('background-image','url(images/ui-bg_gloss-wave_45_e14f1c_500x100.png)');

and to make it completely dynamic you could use ajax call to get the image when the dialog is set up.  it would depend on how the theming changes.

some good info here: http://docs.jquery.com/UI/Dialog#theming
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gbeaulacAuthor Commented:
No that did not work,

I will check the link out.
0
RobOwner (Aidellio)Commented:
When are you changing the theme?  What is the trigger for it to change?
0
gbeaulacAuthor Commented:
@ tagit

I tried a variation of what you mentioned and it worked.

Thanks
0
gbeaulacAuthor Commented:
the variation is this:

$(".ui-widget-header").css('background','url(../css/images/ui-bg_gloss-wave_75_2191c0_500x100.png) 50% 50% repeat-x');
      $(".ui-widget-header").css('border','1px solid #4297d7');
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
AJAX

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.