<table width="100%">
<tbody>
<tr>
<td width="30%"><img width="250" height="135" src="/sites/BGL/Banners_homepage/_t/BGLStaticBanner_JPG.jpg" alt=""/></td>
<td width="70%" valign="top"><div id="imgRotator"> </div></td>
</tr>
</tbody>
</table>
<script src="/sites/BGL/SiteAssets/jquery-2.1.1.js" type="text/javascript"></script>
<script src="/sites/BGL/SiteAssets/jquery.SPServices-2014.01.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
var newBanner =0;
function rotateimages(){
var bannerImg = new Array();
var bannerLink = new Array();
$().SPServices({
operation: "GetListItems",
async: false,
listName: "BGLBanners",
CAMLRowLimit: 10,
completefunc: function (xData, Status) {
var i=0;
$(xData.responseXML).SPFilterNode("z:row").each(function() {
var pictureURL= '/' + $(this).attr("ows_RequiredField");
var bannerLinkURL = $(this).attr("ows_BannerLinkURL");
var n = bannerLinkURL.indexOf(',');
bannerLinkURL = bannerLinkURL.substring(0, n != -1 ? n : s.length);
bannerImg[i]=pictureURL;
bannerLink[i]=bannerLinkURL;
i++;
});
}
});
var totalBan = bannerImg.length;
if (newBanner == totalBan)
{
newBanner = 0;
}
document.getElementById('imgRotator').innerHTML="<a target=_blank href="+bannerLink[newBanner]+"><img height=135 width=650 src="+bannerImg[newBanner]+"></a>";
newBanner++;
setTimeout("rotateimages()", 3*1000);
}
window.onload=function(){
rotateimages();
}
</script>
1 comment:
alert('Hello World!!!')
Post a Comment