Before and After Image Swiper doesn't work

3 replies·opened Apr 22, 2019
L
LinuxCoderApr 22, 2019

How do I add a before & after image swiper? I copied and pasted the code from “Weight-loss Programing”: http://themes.semicolonweb.com/html/canvas/demo-gym.html but it doesn’t work :-(

Any advice?

<div class="section nomargin" style="padding: 80px 0;">
<div class="container clearfix">
<div class="row clearfix">
<div class="col-md-6">
<div class="hidden-xs hidden-sm hidden-md topmargin-lg"></div>
<div class="emphasis-title bottommargin-sm">
<h2 style="font-size: 38px;" class="font-body t600">Weight-loss Programing</h2>
</div>
<p style="color: #777; margin-bottom: 25px;" class="lead">Compellingly generate interactive mindshare without intermandated quality vectors. Professionally implement ethical.</p>
<button type="submit" class="t400 capitalize button button-dark button-large button-circle nomargin" value="submit">Register Now</button>
</div>
<div class="hidden-lg hidden-md topmargin-sm"></div>
<div class="col-md-6">
<div class="twentytwenty-container" style="box-shadow: 0 1px 8px 0 rgba(0,0,0,0.3);">
<img src="demos/gym/images/compared-img/1_1.jpg" alt="Image 1" />
<img src="demos/gym/images/compared-img/1_2.jpg" alt="Image 2" />
</div>
</div>
</div>
</div>
</div>
L
LinuxCoderApr 22, 2019
<!DOCTYPE html>
<html dir="ltr" lang="de-DE">
<head>

	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta name="author" content="Canvas" />

	<!-- Stylesheets
	============================================= -->
	<link href="https://fonts.googleapis.com/css?family=Ubuntu:300,400,400i,500,600,700" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" href="css/bootstrap.css" type="text/css" />
	<link rel="stylesheet" href="style.css" type="text/css" />
	<link rel="stylesheet" href="css/dark.css" type="text/css" />
	<link rel="stylesheet" href="css/font-icons.css" type="text/css" />
	<link rel="stylesheet" href="css/animate.css" type="text/css" />
	<link rel="stylesheet" href="css/magnific-popup.css" type="text/css" />

	<link rel="stylesheet" href="css/responsive.css" type="text/css" />
	<meta name="viewport" content="width=device-width, initial-scale=1" />

	<!-- Document Title
	============================================= -->
	<title>Billy Bob Engineering | We get it done!</title>

</head>

<body class="stretched">

	<!-- Document Wrapper
	============================================= -->
	<div id="wrapper" class="clearfix">

		<!-- Header
		============================================= -->
		<header id="header" class=static-sticky> 

			<div id="header-wrap">

				<div class="container clearfix">

					<div id="primary-menu-trigger"><i class="icon-reorder"></i></div>

					<!-- Logo
					============================================= -->
					<div id="logo">
						<a href="index.html" class="standard-logo" data-dark-logo="images/logo-dark.png"><img src="images/logo.png" alt="billy"></a>
						<a href="index.html" class="retina-logo" data-dark-logo="images/logo-dark@2x.png"><img src="images/logo@2x.png" alt="billy"></a>
					</div><!-- #logo end -->

					<!-- Primary Navigation
					============================================= -->
					<nav id="primary-menu" class="style-4">
						
					<ul>
								<li><a href="index.html">Home</a></li>
								<li><a href="u.html">About us</a></li>
								<li><a href="le.html">Service</a></li>
								<li><a href="#">Let's Talk</a>
								<ul>
								 <li class="current"><a href="wa.html">Project</a></li>
								<li><a href="#">We get it done</a></li>
								<li><a href="#">Test 2</a>    
                                </ul>
                               </li>
								<li><a href="#">test2</a></li>
							</ul>

					</nav><!-- #primary-menu end -->

				</div>

			</div>

		</header><!-- #header end -->
		
		<section id="slider" class="slider-element clearfix" style="height: 530px; background-color:#333333">
		<div class="container clearfix">
		<div class="clearfix center divcenter" style="max-width: 700px;">
		<div class="emphasis-title topmargin">
		<h2 class="font-secondary" style="color: #fff; font-size: 50px; font-weight: 700;">Sicherheit, stabilität, privatsphäre!</h2>
		<div>
		<p style="font-weight: 500; opacity: .7; color: #fff;"> Hello test text <strong>OK</strong> OK.</p>
		</div>
		<div class="col_one_third nobottommargin center">
		<img src="images/icon.png" alt="Image" class="d-none d-lg-block" style="position: absolute; left: 270px; bottom: -240px;" data-height-lg="150">
		</div>
	</div>
	</div>
	</div>
	</section>

		<!-- Content
		============================================= -->
		<section id="content">

			<div class="content-wrap">
			
			<div id="section-features" class="container clearfix">
					<div class="col_full">
					<p>Lorem ipsum dolor sit amet, usu rebum accusam ex, habeo dissentias no vel. Nam at congue adolescens. Ad feugiat iracundia vel, at congue option scripta pri. An prima atomorum cum. Possit appetere eu pro, ea commodo prompta sed. Ei quo suscipit invidunt, ad sed albucius maiestatis. Quem lorem vulputate nam ne.
					Ei duo brute ullum prodesset, pri ei quem enim doctus, ei aperiam deserunt ius. Pri ut vero noluisse vulputate, ceteros insolens mea te. Per eu saperet labores reprimique, vis no dignissim dissentiunt necessitatibus. Vocent elaboraret id has. His ex regione tacimates, ut mei dicunt sensibus dissentias. Vix affert munere eu, quidam admodum laboramus id has. Postea percipit vix an.
					Has ex prima persius, brute admodum senserit te pro. Ne tibique accusamus dignissim nam. At consul altera percipit qui. Pri tritani honestatis no, has ad viderer commune.</p>
					</div>
					</div>
				<div class="section nomargin" style="padding: 80px 0;">
				<div class="container clearfix">
				<div class="row clearfix">
				<div class="col-md-6">
				<div class="hidden-xs hidden-sm hidden-md topmargin-lg"></div>
				<div class="emphasis-title bottommargin-sm">
				<h2 style="font-size: 38px;" class="font-body t600">Weight-loss Programing</h2>
				</div>
				<p style="color: #777; margin-bottom: 25px;" class="lead">Compellingly generate interactive mindshare without intermandated quality vectors. Professionally implement ethical.</p>
				<button type="submit" class="t400 capitalize button button-dark button-large button-circle nomargin" value="submit">Register Now</button>
				</div>
				<div class="hidden-lg hidden-md topmargin-sm"></div>
				<div class="col-md-6">
				<div class="twentytwenty-container" style="box-shadow: 0 1px 8px 0 rgba(0,0,0,0.3);">
			<img src="demos/gym/images/compared-img/1_1.jpg" alt="Image 1" />
			<img src="demos/gym/images/compared-img/1_2.jpg" alt="Image 2" />
		</div>
		</div>
		</div>
		</div>
		</div>
			</div>

		</section><!-- #content end -->
<!-- Footer
		============================================= -->
		<footer id="footer" class="dark">

			<div class="container">

				<!-- Footer Widgets
				============================================= -->
				<!-- .footer-widgets-wrap end -->

			</div>

			<!-- Copyrights
			============================================= -->
			<div id="copyrights">
					
				<div class="container center clearfix">
				Copyrights &copy; 2019 Canvas Theme.<div class="copyright-links"><a href="#">Legal Notice</a> / <a href="#">Privacy</a></div>
			</div>
			</div>

		</footer><!-- #footer end -->

	</div><!-- #wrapper end -->

	<!-- Go To Top
	============================================= -->
	<div id="gotoTop" class="icon-angle-up"></div>

	<!-- External JavaScripts
	============================================= -->
	<script src="js/jquery.js"></script>
	<script src="js/plugins.js"></script>

	<!-- Footer Scripts
	============================================= -->
	<script src="js/functions.js"></script>

</body>
</html>
L
LinuxCoderApr 23, 2019

Never mind, I fixed it :-).

Turned out I was missing /foundation.css, external javaScripts, and:

<script>
    $(function(){
      $(".twentytwenty-container[data-orientation!='vertical']").twentytwenty({default_offset_pct: 0.7});
      $(".twentytwenty-container[data-orientation='vertical']").twentytwenty({default_offset_pct: 0.3, orientation: 'vertical'});
    });
    </script>
S
SemiColonWebSTAFFApr 24, 2019

Hello,

Really Glad that your issues were resolved. Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard