<script src="https://www.ohiochristian.edu/sites/default/files/bootstrap-native-v4.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js"></script>
<link rel="stylesheet" href="https://www.ohiochristian.edu/sites/default/files/ocu.style.css">
<div class="container">
<input id="tab1" type="radio" name="tabs" checked>
<label for="tab1">NEWS</label>
<input id="tab2" type="radio" name="tabs">
<label for="tab2">SPORTS</label>
<section id="content1">
<div class="row ocu-carousel">
<!-- ROW -->
<div class="carousel slide col-sm-5 col-md-6 col-lg-7" data-ride="carousel" data-interval="5000">
<div class="carousel-inner">
<div class="carousel-item">
<div class="carousel-image-container"><a href="#"><img src="http://dev.ohiochristian.edu/sites/default/files/news_1.jpg"></a><span>FEBRUARY 5TH, 2019</span></div>
<h3 class="carousel-text"><a href="#">Marketing and Consumer Behavior Degree Opens Doors</a></h3>
<p class="carousel-text">Ohio Christian University’s Information Technology and Data Analytics degrees train students for high-tech careers in today’s ever-changing environment. By offering both a Bachelor of Science in Information Technology and a Bachelor of Science
in Data Analytics, OCU prepares students to meet all the challenges in these continually growing and evolving fields.</p>
</div>
<div class="carousel-item">
<div class="carousel-image-container"><a href="#"><img src="http://dev.ohiochristian.edu/sites/default/files/news_2.jpg"></a><span>FEBRUARY 8TH, 2019</span></div>
<h3 class="carousel-text"><a href="#">4.0 Students Recognized in Chapel Service</a></h3>
<p class="carousel-text">The January 23rd Chapel Service included a time of recognition for students who achieved a 4.0 grade point average during the fall semester. Dr. Hank Kelly, Provost, presented each awardee...
/*
* This function primarily watches the Bootstrap Carousel and interacts
* with a side thumbnail menu. The object instantiation is due to the
* possibility that more than one carousel maybe active at a time.
* other features include
* • auto-resizing of the thumbnail menu
* • All images being a background-image to allow for auto-centering and cropping
* • Automatic text redaction based on dynamic re-sizing of the container
*/
// this object is instatiated as window.OCU.carousels[x];
var OCUCarousel = function(index, element) {
this.childCarousel = index;
this.element = element;
this.carousel = window.document.getElementsByClassName('carousel');
this.imageContainers = this.element.getElementsByClassName('carousel-image-container');
this.carouselText = this.element.getElementsByClassName('carousel-text');
this.thumbnailTextP = this.element.querySelectorAll('.thumbnail-text > p');
this.carouselInner = this.element.querySelectorAll('.carousel-inner');
this.thumbnails = this.element.querySelectorAll('.thumbnail');
this.carouselItems = this.element.querySelectorAll('.carousel-item');
this.marker = this.element.querySelector('.thumbnail-marker');
this.ratio = .7322; // the Ratio is used to determine the height vs width of the image
// This init function is run at the bottom of the object.
this.init = function() {
console.log('OCU.carousels[' + this.childCarousel + '] instantiated');
this.matchHeights();
this.setThumbnailImages();
window.addEventListener("resize", this);
this.addCLickEvents(this.thumbnails);
this.startObservation();
};
// set thumbnail background images based on carousel images to reduce load times and image sizes
this.setThumbnailImages = function() {
// collect correct THIS HTML NodeList
let carouselImages = this.element.querySelectorAll('.carousel-image-container img');
let thumbnailImageDIV = this.element.querySelectorAll('div.thumbnail-image');
// ES6 function...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.