- Jun 2, 2009
- 488
- 13
- 81
I took a job integrating html5lightbox into a client's Bootstrap website and writing a JS price calculator for him (no checkout functionality, maybe Paypal later). Looked like an easy job but I'm running into trouble getting the lightbox to work a) as expected and/or b) in conjunction with his other JS. The head code may be useful here:
---
<head>
<meta charset="UTF-8">
<title>title</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="css/lib/bootstrap.min.css">
<link rel="stylesheet" href="css/lib/font-awesome.min.css">
<link rel="stylesheet" href="css/lib/owl.carousel.css">
<link rel="stylesheet" href="css/lib/owl.theme.css">
<link rel="stylesheet" href="css/lib/owl.transitions.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/colors/cyan.css">
<script type="text/javascript" src="html5lightbox/jquery.js"></script>
<script type="text/javascript" src="html5lightbox/html5lightbox.js"></script>
</head>
---
So the way html5lightbox works is just that you put the necessary scripts in the header (the last two in this case; html5lightbox uses jquery) and then assign the html5lightbox class to any video you want lightboxed.
The client is hosting videos on Youtube (which html5lightbox specifically supports) so I'm using the embed rather than watch link as per the examples on the html5lightbox site: https://html5box.com/html5lightbox/index.php
In all cases (he's got about a dozen videos he's wanting lightboxed) the videos redirect to something hosted on Youtube rather than lightboxing properly within his site.
I suspect that the html5lightbox js is conflicting with his transitions js since they both require a css class to be added to the <a> tag. Here's the first video code block:
---
<div class="item work-item zoomOut col-xs-12 col-sm-6 col-md-4 corporate liveaction animated">
<div class="item-inner">
<a class="image-wrap html5lightbox" href="https://www.youtube.com/embed/YE7VzlLtp-4">
<img src="images/portfolio/gpecstillsmall4.jpg" alt="" class="image">
<div class="caption bg-orange-red">
<div class="inner">
<h4 class="sm text-uppercase">Corp</h4>
<font color="#ffffff" face="Playfair Display, serif"><em>Name</em></font><br>
</div>
</div>
</a>
</div>
</div>
---
Any thoughts on this? I'm halfway decent at js but hardly a ninja (obviously).
---
<head>
<meta charset="UTF-8">
<title>title</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="css/lib/bootstrap.min.css">
<link rel="stylesheet" href="css/lib/font-awesome.min.css">
<link rel="stylesheet" href="css/lib/owl.carousel.css">
<link rel="stylesheet" href="css/lib/owl.theme.css">
<link rel="stylesheet" href="css/lib/owl.transitions.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/colors/cyan.css">
<script type="text/javascript" src="html5lightbox/jquery.js"></script>
<script type="text/javascript" src="html5lightbox/html5lightbox.js"></script>
</head>
---
So the way html5lightbox works is just that you put the necessary scripts in the header (the last two in this case; html5lightbox uses jquery) and then assign the html5lightbox class to any video you want lightboxed.
The client is hosting videos on Youtube (which html5lightbox specifically supports) so I'm using the embed rather than watch link as per the examples on the html5lightbox site: https://html5box.com/html5lightbox/index.php
In all cases (he's got about a dozen videos he's wanting lightboxed) the videos redirect to something hosted on Youtube rather than lightboxing properly within his site.
I suspect that the html5lightbox js is conflicting with his transitions js since they both require a css class to be added to the <a> tag. Here's the first video code block:
---
<div class="item work-item zoomOut col-xs-12 col-sm-6 col-md-4 corporate liveaction animated">
<div class="item-inner">
<a class="image-wrap html5lightbox" href="https://www.youtube.com/embed/YE7VzlLtp-4">
<img src="images/portfolio/gpecstillsmall4.jpg" alt="" class="image">
<div class="caption bg-orange-red">
<div class="inner">
<h4 class="sm text-uppercase">Corp</h4>
<font color="#ffffff" face="Playfair Display, serif"><em>Name</em></font><br>
</div>
</div>
</a>
</div>
</div>
---
Any thoughts on this? I'm halfway decent at js but hardly a ninja (obviously).