Hey guys, I need some help with my script to get the slideshow working. Also I l
ID: 3775263 • Letter: H
Question
Hey guys, I need some help with my script to get the slideshow working. Also I linked a video in and wont work. I appreciate the help!
Page 1: About You
This page must contain the structural/semantic elements using the HTML5 elements; See pages 48 in your red Web Design book. Be certain to use the nav element for the links to your other pages.
You may want to use structural/semantic elements for all of your pages and keep the nav element the same on every page.
Incorporate a slideshow of 7 images relating to you/your family/your hometown/your hobbies
Incorporate a video[1] about your favorite TED talk. Cite your sources using links.(MLA format is optional)
<!DOCTYPEhtml>
<html>
<head>
<meta charset="UTF-8">
<title>Final Project</title>
<!--Zachary Khammash Section 004 September 8, 2016 -->
<style>
body {background-color: #D4E6F1;
padding: 100px;
border:4px
display: block;
text-align: left }
nav{text-align:left;}
h1 {color: #E59866
font-size:14pt}
</style>
</head>
<script>
</script>
<body>
<article>
<header><h1>CSCE 102 Final Project</h1></header>
<nav>
<b>
<a href="FinalProject.html">Home</a>
<a href="FinalProjectPage2.html">Quiz</a>
<a href="FinalProjectPage3.html">Calculator</a>
</b>
</nav>
<section>
<h1>Home Page</h1>
</article>
<th colspan="7">My Life</th>
<table>
<tr>
<td><img src="All_Images/IMG_1600.jpg" title= "Sister" width="100"
height="100" id="pic1"></td>
<td><img src="All_Images/IMG_3582.jpg" title= "Flying Lesson" width="200"
height="200" id="pic2"></td>
<td><img src="All_Images/IMG_3847.jpg" title= "Mom" width="200"
height="200" id="pic3"></td>
<td><img src="All_Images/IMG_4060.jpg" title= "Me" width="200"
height="200" id="pic4"></td>
<td><img src="All_Images/IMG_4768.jpg" title= "Traveling with Cousin" width="200"
height="200" id="pic5"></td>
<td><img src="All_Images/IMG_4896.jpg" title= "Traveling with Cousin" width="200"
height="200" id="pic6"></td>
<td><img src="All_Images/IMG_5063.jpg" title= "Traveling with Cousin" width="200"
height="200" id="pic7"></td>
</tr>
<tr>
<td colspan="7"><img id="mainIMG" width="450" height="450" src="All_Images/IMG_3582.jpg" alt="Me"></td>
</tr>
<tr>
<th colspan="7" id="desc">Be happy for this moment. This moment is your life.</th>
</tr>
<tr>
<td colspan="7"><input type="button" value="StartSlideshow">
</td>
</tr>
<tr>
<td colspan="7"><input type="button" value="StopSLideshow">
</td>
</tr>
</table>
<table>
<th>Favorite TED Talk</th>
<video width="320" height="245" controls>
<header>Favorite TED Talk<header>
<source src="TED.mpeg" type="video/mpeg">
</video>
</table>
</body>
</html>
Explanation / Answer
Your code didn't seem to work for odd reason.
Here in the below code is the new layout for your pictures for slideshow and video
code to copy:
<!DOCTYPEhtml>
<html>
<head>
<meta charset="UTF-8">
<title>Final Project</title>
<!--Zachary Khammash Section 004 September 8, 2016 -->
<style>
body {background-color: #D4E6F1;
padding: 100px;
border:4px
display: block;
text-align: left }
nav{text-align:left;}
h1 {color: #E59866
font-size:14pt}
</style>
</head>
<script>
</script>
<body>
<article>
<header><h1>CSCE 102 Final Project</h1></header>
<nav>
<b>
<a href="FinalProject.html">Home</a>
<a href="FinalProjectPage2.html">Quiz</a>
<a href="FinalProjectPage3.html">Calculator</a>
</b>
</nav>
<section>
<h1>Home Page</h1>
</article>
<th colspan="7">My Life</th>
<table>
<tr>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {box-sizing:border-box}
body {font-family: Verdana,sans-serif;}
.mySlides {display:none}
/* Slideshow container */
.slideshow-container {
max-width: 1000px;
position: relative;
margin: auto;
}
/* Caption text */
.text {
color: #f2f2f2;
font-size: 15px;
padding: 8px 12px;
position: absolute;
bottom: 8px;
width: 100%;
text-align: center;
}
/* Number text (1/3 etc) */
.numbertext {
color: #f2f2f2;
font-size: 12px;
padding: 8px 12px;
position: absolute;
top: 0;
}
/* The dots/bullets/indicators */
.dot {
height: 13px;
width: 13px;
margin: 0 2px;
background-color: #bbb;
border-radius: 50%;
display: inline-block;
transition: background-color 0.6s ease;
}
.active {
background-color: #717171;
}
/* Fading animation */
.fade {
-webkit-animation-name: fade;
-webkit-animation-duration: 1.5s;
animation-name: fade;
animation-duration: 1.5s;
}
@-webkit-keyframes fade {
from {opacity: .4}
to {opacity: 1}
}
@keyframes fade {
from {opacity: .4}
to {opacity: 1}
}
/* On smaller screens, decrease text size */
@media only screen and (max-width: 300px) {
.text {font-size: 11px}
}
</style>
<body>
<h2>Automatic Slideshow</h2>
<p>Change image every 2 seconds:</p>
<div class="slideshow-container">
<div class="mySlides fade">
<div class="numbertext">1 / 7</div>
<img src="All_Images/IMG_1600.jpg">
<div class="text">Sister</div>
</div>
<div class="mySlides fade">
<div class="numbertext">2 / 7</div>
<img src="All_Images/IMG_3582.jpg">
<div class="text">Flying Lesson</div>
</div>
<div class="mySlides fade">
<div class="numbertext">3 / 7</div>
<img src="All_Images/IMG_3847.jpg">
<div class="text">Mom</div>
</div>
<div class="mySlides fade">
<div class="numbertext">4 / 7</div>
<img src="All_Images/IMG_4060.jpg">
<div class="text">ME</div>
</div>
<div class="mySlides fade">
<div class="numbertext">5 / 7</div>
<img src="All_Images/IMG_4768.jpg">
<div class="text">Traveling with Cousin</div>
</div>
<div class="mySlides fade">
<div class="numbertext">6 / 7</div>
<img src="All_Images/IMG_4896.jpg">
<div class="text">Traveling with Cousin</div>
</div>
<div class="mySlides fade">
<div class="numbertext">7 / 7</div>
<img src="All_Images/IMG_5063.jpg">
<div class="text">Caption Three</div>
</div>
</div>
<br>
<div>
<span class="dot"></span>
<span class="dot"></span>
<span class="dot"></span>
<span class="dot"></span>
<span class="dot"></span>
<span class="dot"></span>
<span class="dot"></span>
</div>
<script>
var slideIndex = 0;
showSlides();
function showSlides() {
var i;
var slides = document.getElementsByClassName("mySlides");
var dots = document.getElementsByClassName("dot");
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
slideIndex++;
if (slideIndex> slides.length) {slideIndex = 1}
for (i = 0; i < dots.length; i++) {
dots[i].className = dots[i].className.replace(" active", "");
}
slides[slideIndex-1].style.display = "block";
dots[slideIndex-1].className += " active";
setTimeout(showSlides, 2000); // Change image every 2 seconds
}
</script>
<th>Favorite TED Talk</th>
<video width="400" controls>
<header>Favorite TED Talk<header>
<source src="TED.mpeg" type="video/mp4">
//code for audio, if you have any
<source src="" type="video/ogg">
.
</video>
</body>
</html>