|
-
Aug 18th, 2015, 05:31 PM
#1
Slide Show Code
So Im googling for some simple code to throw on my website which is a hosted shopping cart solution. So I cant use .net or anything like that. Just some good ole html, javascript and css I would suppose would be the most widely compatible code.
Lots of snippet sites but spent enough time reading through bs sites that dont deliver or have little to offer.
Whats everyones favorite snippet site or such?
Just looking for slide show with some control and autoplay
Thanks
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 
-
Aug 18th, 2015, 06:01 PM
#2
Re: Slide Show Code
Maybe it's time to try jQuery and one of the plugins
https://plugins.jquery.com/tag/slideshow/
-
Aug 18th, 2015, 06:35 PM
#3
Re: Slide Show Code
Yea I suppose but I havent done any real web stuff in a while. Seems overkill? Theres no demo or preview of it?
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 
-
Aug 18th, 2015, 06:50 PM
#4
Re: Slide Show Code
If you want simple to implement then skip the jQuery stuff - you would want to use it for other reasons (I do lots and lots of DOM changes and use jquery grids and datepickers and fancy stuff like animated graphs).
Google for 10 BEST JAVASCRIPT SLIDESHOWS and see where that gets you - that's usually how I find my jQuery stuff.
-
Aug 18th, 2015, 09:22 PM
#5
Re: Slide Show Code
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.
-
Aug 19th, 2015, 12:43 PM
#6
Re: Slide Show Code
 Originally Posted by szlamany
If you want simple to implement then skip the jQuery stuff - you would want to use it for other reasons (I do lots and lots of DOM changes and use jquery grids and datepickers and fancy stuff like animated graphs).
Google for 10 BEST JAVASCRIPT SLIDESHOWS and see where that gets you - that's usually how I find my jQuery stuff.
Thanks! I googled and would get all kinds of lame results. Trying not to have any dependancies as I cannot upload any third party dlls.
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 
-
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 
-
Aug 21st, 2015, 01:27 PM
#8
Re: Slide Show Code
 Originally Posted by RobDog888
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! 
I done did s'more diggin and I found this: http://jsfiddle.net/hellosze/mU2h9/
It pauses on hover and gives the user the option to chose the desired picture too.
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
|