I have been working with jQuery and trying to apply the max-width property to my images affected by jQuery without success. Can someone please assist me? Below is the code I have been working with:
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
</head>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script>
$(window).load(function () {
setTimeout(function () {
$('div.fade > div') . fadeIn(3000) // 3 second fade in
}, 2000) // after 2 seconds.
})
</script>
<style>
.img{
max-width: 100%;
}
html
{
background-image:url(purplegrad.png);
background-position: center;
}
.container
{
position:relative;
margin-top:100px;
}
.fade
{
position:relative;
width:800px;
z-index:1;
margin:auto;
}
.inside
{
position: absolute;
display: none;
z-index:2;
top:0;
left:0;
}
</style>
<body>
<div class="container">
<div class="fade">
<img class="img" src="namelarge.png" />
<div class="inside">
<img class="img" src="nameglow.png" />
</div>
</div>
</div>
</body>
</html>
Furthermore, someone from the jQuery forum provided this helpful example of my jQuery implementation: http://jsfiddle.net/jakecigar/HS2f9/