Lastchapter ppt2
Lastchapter ppt2
The status bar in JavaScript can be manipulated using the window.status property. This property allows
you to set the text displayed in the browser’s status bar. However, it’s important to note that this feature
is deprecated and may not work in all modern browsers due to security concerns
<html>
<body>
<script>
</script>
</body>
</html>
In this blog, we will know how to scroll the text in the status bar using JavaScript.
<html>
<head>
<title>Javascript ScrollText</title>
<script language="javascript">
spacer="............ .............";
pos=0;
function ScrollMessage()
{
window.status=msg.substring(pos,msg.length)+spacer+msg.substring(0,pos);
pos++;
if(pos>msg.length)
pos=0;
window.setTimeout("ScrollMessage()",100);
ScrollMessage();
</script>
</head>
<body>
</body>
</html>
Banner in Javascript
MyBanners=new Array(‘banner1.jpg’,’banner2.jpg’,’banner3.jpg’,’banner4.jpg’)
<html>
<head>
<script language="Javascript">MyBanners=new
Array('banner1.jpg','banner2.jpg','banner3.jpg','banner4.jpg')
banner=0
function ShowBanners()
{ if (document.images)
{ banner++
if (banner==MyBanners.length) {
banner=0}
document.ChangeBanner.src=MyBanners[banner]
setTimeout("ShowBanners()",5000)
</script>
<body onload="ShowBanners()">
<center>
</body>
</html>
Creating rotating banner images will provide the visitor to your webpage with
some basic information. However, if you want the visitor to get more information
by clicking on the banner images, you need to create rotating banner ads that
contain URL links.
The script is basically the same as the previous one but we need to add another
array that comprises the links, as follows:
MyBannerLinks=new Array('URL1','URL2','URL3/','URL4/')
<html>
<head>
<script language="Javascript">MyBanners=new
Array('banner1.jpg','banner2.jpg','banner3.jpg','banner4.jpg')
MyBannerLinks=new
Array('http://www.vbtutor.net/','http://www.excelvbatutor.com/','http://
onlinebizguide4you.com/','http://javascript-tutor.net/')
banner=0
function ShowLinks(){
document.location.href="http://www."+MyBannerLinks[banner]
}function ShowBanners()
{ if (document.images)
{ banner++
if (banner==MyBanners.length) {
banner=0}
document.ChangeBanner.src=MyBanners[banner]
setTimeout("ShowBanners()",5000)
</script>
<body onload="ShowBanners()">
<center>
</center>
</body>
</html>
Slideshow
<!DOCTYPE html>
<html>
<head>
<style>
* {box-sizing: border-box}
/* Slideshow container */
.slideshow-container {
max-width: 1000px;
position: relative;
margin: auto;
.prev, .next {
cursor: pointer;
position: absolute;
top: 50%;
width: auto;
padding: 16px;
margin-top: -22px;
color: white;
font-weight: bold;
font-size: 18px;
user-select: none;
.next {
right: 0;
.prev:hover, .next:hover {
background-color: rgba(0,0,0,0.8);
/* Caption text */
.text {
color: #f2f2f2;
font-size: 15px;
position: absolute;
bottom: 8px;
width: 100%;
text-align: center;
.numbertext {
color: #f2f2f2;
font-size: 12px;
position: absolute;
top: 0;
/* The dots/bullets/indicators */
.dot {
cursor: pointer;
height: 15px;
width: 15px;
margin: 0 2px;
background-color: #bbb;
border-radius: 50%;
display: inline-block;
.active, .dot:hover {
background-color: #717171;
/* Fading animation */
.fade {
animation-name: fade;
animation-duration: 1.5s;
@keyframes fade {
to {opacity: 1}
}
/* On smaller screens, decrease text size */
</style>
</head>
<body>
<div class="slideshow-container">
</div>
</div>
<div class="mySlides fade">
</div>
</div>
<br>
<div style="text-align:center">
</div>
<script>
let slideIndex = 1;
showSlides(slideIndex);
function plusSlides(n) {
showSlides(slideIndex += n);
function currentSlide(n) {
showSlides(slideIndex = n);
function showSlides(n) {
let i;
slides[i].style.display = "none";
slides[slideIndex-1].style.display = "block";
dots[slideIndex-1].className += " active";
</script>
</body>
</html>