How to apply different colors in Jquery dialog box using dynamic way
I use following code. I need to apply multiple colors (themes) for each dialog box . is it possible ? The dialog box are created dynamic way. You can see see that from the code.
I have 2 links (see that code below the jquery code) and each time It create different dialog box.
Need to apply different background color and border color for each dialog. I mean First dialog background-color:red, for the secod - background-color:blue
- $(function () {
- $('a.clk').on('click', function (e) {
- e.preventDefault();
- $('<div/>', { 'class': 'myDlgClass', 'id': 'link-' + ($(this).index() + 1) })
- .load($(this).attr('href')).appendTo('body')
- .dialog({
- 'title': $(this).text(),
- 'width': 600,
- //dialogClass: "no-close",
- closeText: "",
-
- position: {
- my: "left+5% top+5%",
- at: "left top",
- of: $('.myDlgClass').prev()
- },
- 'height': 400
- /*
- buttons: [{
- text: "Close",
-
- click: function () { $(this).dialog("close"); }
- }] */
- });
- });
- });
Html parts are
- <a class="clk" href="test.html">Engine</a>
- <a class="clk" href="test2.html">Parts</a>