I would like to drop a shadow / blur the background of the div id = "test" dialog box, I have tried using the jquery ui provided class .ui-widget-shadow / .ui-widget-overlay but it doesn’t seem working properly. Is there any way to achieve this? Thanks.
<style>
div {
display: none;
width: 90%;
height: 95%;
margin-left:5%;
background: #ccc;
border: 1px solid #000;
}
div img {
display: inline;
margin-left:5%;
}
</style>
<script src="http://code.jquery.com/jquery-1.8.3.js"></script>
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
</head>
<body>
<button>show the div</button>
<div id = 'test'> <img src = 'image.png'></div>
<script>
$( "button" ).click(function() {
$( "div" ).show( "scale", 180 );
});
$( "#test" ).dblclick(function() {
$( "#test" ).hide( "scale", 200 );
});
</script>
You haven’t done anything related!
If you need a
drop-shadowfor the#test, then you can use this CSS:You can generate the code using many online
box-shadowgenerators.Else, if you need something like a modal window, which hides or blurs the background, you need to add another
divand givez-index, etc. You can see more information from: Simple jQuery Modal Window Tutorial.