Exp 15
Exp 15
15
Aim: Develop a web page for implementing slideshow and banner.
Theory:
Banner Advertisement:
The banner advertisement is the hallmark of every commercial web page. It is typically positioned near the
top of the web page, and its purpose is to get the visitor's attention by doing all sorts of clever things. Nearly
all banner advertisements are in a file format such as a GIF, JPG, TIFF, or other common graphic file
formats. Some are animated GIFs, which is a series of images contained in one file that rotate automatically
on the screen. Some are Flash movies that require the visitor to have a browser that includes a Flash plug-in.
Many banner advertisements consist of a single graphical image that does not contain any animation and
does not require any special plug-in.
3. Pause before displaying the next banner advertisement: Set the timer.
setTimeout('DisplayBanners()',1000)
Slide show:
A slideshow is like a banner advertisement but with rotating images on the web page. A slideshow gives the
visitor the ability to change the image that's displayed: the visitor can click the Forward button to see the
next image and the Back button to see the previous image.
4. Define RunSlideShow() function inside <script> tag. It accepts one parameter. If the value is 1, then the
value of the CurrentPicture is incremented, causing the next slide to be displayed. If the value is –1, then
the value of the CurrentPicture is decremented, causing the previous slide to be displayed. Before
displaying the slide, we must determine whether the value of the CurrentPicture variable is within the
index range of the array. This is done by making sure that the value of the CurrentPicture variable isn't
greater than the last array element (Pictures.length – 1) and that value is not less than the first array
element (less than zero). If the value is beyond the range, then the value of the CurrentPicture variable is
reset to a valid index. The last step is to assign the proper array element containing the slide to the src
attribute of the tag, which is called PictureDisplay.
if(CurrentPicture<0)
CurrentPicture=Pictures.length-1;
document.PictureDisplay.src= Pictures[CurrentPicture];
CurrentPicture = CurrentPicture + i;
}
}
</script>
</head>
<body>
<p align="center"><img src="s4.png" name="PictureDisplay" width="400" height="275"/></p>
<center>
<table border="0">
<tr>
<td align="center">
<input type="button" value="Forward" onclick="RunSlideShow(1)">
<input type="button" value="Back" onclick="RunSlideShow(-1)">
</td>
</tr>
</table>
</center>
</body>
</html>
Conclusion:
With all the concepts based on creation of banner and slideshow , successfully executed all programs with
correct output.