|
-
Aug 19th, 2015, 01:51 PM
#7
Re: Slide Show Code
 Originally Posted by dday9
For shlits and giggles, I tried to make a slideshow and I'm fairly happy with it:
HTML
HTML Code:
<div class="Slideshow">
<input checked="checked" class="SlideGroup" id="Group1" name="SlideGroup" type="radio" />
<label class="SlideHeader" for="Group1">Image1</label>
<img alt="image1" class="AccordionTab" src="http://lorempixel.com/400/200/cats" />
<input class="SlideGroup" id="Group2" name="SlideGroup" type="radio" />
<label class="SlideHeader" for="Group2">Image2</label>
<img alt="image2" class="AccordionTab" src="http://lorempixel.com/400/200/sports" />
<input class="SlideGroup" id="Group3" name="SlideGroup" type="radio" />
<label class="SlideHeader" for="Group3">Image3</label>
<img alt="image3" class="AccordionTab" src="http://lorempixel.com/400/200/people" />
</div>
CSS
Code:
.Slideshow *, .SlideGroup:checked + label, .SlideGroup:checked + label + img {
display: block;
}
.SlideGroup, .SlideGroup + label, .SlideGroup + label + img {
display: none;
}
.SlideGroup:checked + label {
background-color: rgb(40, 44, 47);
border-top-left-radius: 5px;
border-top-right-radius: 5px;
color: #fff;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-ms-transition: all 0.2s;
-o-transition: all 0.2s;
transition: all 0.2s;
}
.SlideHeader:hover {
background-color: rgb(40, 44, 47);
color: #fff;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
-ms-transition: all 0.2s;
-o-transition: all 0.2s;
transition: all 0.2s;
}
.SlideHeader {
background-color: #fff;
border: 1px solid #ccc;
color: #000;
cursor: pointer;
padding-left: 1em;
padding-top: 1em;
}
.Slideshow img {
background-color: #fff;
border: 1px solid #ccc;
}
JavaScript
Code:
var index = 0;
var radios = ["Group1", "Group2", "Group3"];
window.onload = function () {
slide();
};
function slide() {
index++;
if (index > radios.length - 1) {
index = 0;
}
document.getElementById(radios[index]).checked = true;
setTimeout("slide()", 1750);
}
Fiddle
http://jsfiddle.net/6L4wjpyc/
It can be improved on by far, but it's something.
Yea thats the basics and like what I would find but I need bullets, controls, links and pause on mouseover
Thats a nice online ide site for js!
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|