EasyUI Forum

General Category => General Discussion => Topic started by: anugrast on September 10, 2016, 08:45:32 PM



Title: Messanger
Post by: anugrast on September 10, 2016, 08:45:32 PM
How to make different style for each messager alert type.
I mean, if we use
$.messager.alert('My Title','Here is a error message!','error') a background color is red (header and body)
$.messager.alert('My Title','Here is a error message!','warning') a background color is orange (header and body)

Please help


Title: Re: Messanger
Post by: stworthy on September 11, 2016, 05:00:41 PM
You can define different CSS classes that will be used to assign to the 'cls' property for the message dialog. Please try this code:
Code:
<style type="text/css">
.cls1,.cls1:hover,.cls1>.panel-header{
border-color: red;
background: red;
}
.cls1>.panel-body{
border-color: red;
background: red;
}
.cls1>.dialog-toolbar,.cls1>.dialog-button{
border-color: red;
background: red;
}
</style>

Apply this 'cls1' CSS class to the message dialog.
Code:
$.messager.alert({
title: 'My Title',
msg: 'Here is a error message!',
icon: 'error',
cls: 'cls1'
});


Title: Re: Messanger
Post by: anugrast on September 12, 2016, 01:48:02 AM
Thanks stworthy... you're the best...