css unit 6
css unit 6
-----------------------------------------------------------------------------------
----------------------
Status Bar:
-->
Status bar is present at the bottom of browser window.
When you move your mouse over an html link, the url appears in the status bar.
It enhances readability of the text present on web page when user scrolls over it.
Some developers display a message on the status bar when the web page first opens.
Other developers might change the message to reflect whatever the visitor is doing
on the web page.
For example, if a user is filling registration form then status bar will display a
text as 'User is on form filling section'.
Banner
-----------------------------------------------------------------------------------
---------------------
Banner:
-->
Banner is hallmark of every commercial webpage.
Banner advertisements are image based and are popular form of website advertising.
It is placed either above, below or sides on the websites main content.
It is also refered as banner advertisement.
Ex:
<!DOCTYPE html>
<html>
<head>
<title>Banner Ex</title>
</head>
<body>
<a href="http://www.google.com">
<img src="banner.jpg" alt="Banner" width="468" height="60">
</a>
</body>
</html>
Rotating Banners:
-->
Steps:
1. Load banner advertisements into an array.
2. Determine whether the browser supports the image object.
3. Display a banner advertisement.
4. Pause before displaying the next banner advertisement.
Ex:
<html>
<head>
<title>Link Banner Ads</title>
<script language="Javascript" type="text/javascript">
Banners = new Array("banner.jpg", "banner2.jpg");
BannerLink = new Array("google.com/", "coke.com/");
CurrentBanner = 0;
NumOfBanners = Banners.length;
function LinkBanner() {
document.location.href = "http://www." + BannerLink[CurrentBanner];
}
function DisplayBanners() {
if (document.images) {
CurrentBanner++;
if (CurrentBanner == NumOfBanners) {
CurrentBanner = 0;
}
document.RotateBanner.src = Banners[CurrentBanner];
setTimeout("DisplayBanners()", 1000);
}
}
</script>
</head>
<body onload="DisplayBanners()">
<center>
<a href="javascript: LinkBanner()">
<img src ="banner.jpg" width="400" height="75" name="RotateBanner"/></a>
</center>
</body>
</html>
Slideshow
-----------------------------------------------------------------------------------
--------------------
Slideshow
-->
A slideshow is a similar to a banner advertisement in which multiple images rotate
inside a <img> element on the web page.
Slideshow provides the functionality to visitor to move next or back image as and
when required.
Ex:
<html>
<head>
<script>
pics = new Array("banner.jpg", "banner2.jpg", "banner3.jpg");
count = 0;
function slideshow(status) {
if (document.images) {
count = count + status;
if (count > pics.length - 1) {
count = 0;
}
if (count < 0) {
count = pics.length - 1;
}
document.img1.src = pics[count];
}
}
</script>
</head>
<body>
<img src="banner.jpg" width="200" name="img1" />
<br />
<input type="button" value="Next" onclick="slideshow(1)" />
<input type="button" value="Back" onclick="slideshow(-1)" />
</body>
</html>
<html>
<head>
<title> Slideshow</title>
</head>
<body>
<script>
c=0;
pic=['banner.jpg','banner2.jpg','banner3.jpg'];
function slides(status){
c+=status;
if(c>pic.length-1){
c=0;
}
if(c<0){
c=pic.length-1;
}
document.imgs.src=pic[c];
}
}
</script>
<img src="banner.jpg" width="200" name="imgs">
<br>
<input type="button" value="Next" onclick="slides(1)">
<input type="button" value="Back" onclick="slides(-1)">
</body>
</html>