Features:- Set Images as a background in parent div.
HTML:
HTML:
<ul>
<li class="bg0"> <img src="images/homebanner1.jpg" width="1349" height="700" alt=""> </li>
<li class="bg1"> <img src="images/homebanner2.jpg" width="1349" height="700" alt=""> </li>
<li class="bg2"> <img src="images/homebanner3.jpg" width="1349" height="700" alt=""> </li>
<li class="bg3"> <img src="images/homebanner4.jpg" width="1349" height="700" alt=""> </li>
</ul>
jQuery:
$("ul li img").each(function(a){var b=$(this).attr("src");$("ul li.bg"+a).css("background-image","url("+b+")")});
|
No comments:
Post a Comment