I have form and send data from it via ajax to php file and get result e.g. 0 and 1
If I get 0 as a result, I'd like to like to show red fancybox (body and border) if I get 1, show green fancybox (body and border)
Ok - I defined styles in css:
<style type="text/css">
#green {
background-color: #bef781;
}
#red {
background-color: #f5a9a9;
}
#fancybox-content #red {
border: 10px solid #f5a9a9 !important;
background-color: #f5a9a9;
}
</style>
and attach them to div in response from ajax:
$.ajax(
{
url : formURL,
type: "POST",
data : postData,
success: function(response)
{
if (response == "1") {
$.fancybox("<div id=\"green\";><h1>Green response</h1></div>");
}
else {
$.fancybox("<div id=\"red\";><h1>Red response</h1></div>");
}
}
}
Both boxes are showing as expected but the problem is with border - in css I can change default white color like this:
#fancybox-content {
border: 30px solid #bef781 !important;
}
and it's working but only for one box (green or red) - how to change border in second box ??
Regards