Problem
I fully understand that I cannot take a downsized image, scale it up with CSS, and not have it look blurry. But I also know I'm going about this wrong, and there is a way to do what I'm wanting.
I want to achieve this exact effect I've created, but without losing the clarity on the second (flipped / backside) card. I feel like the solution lies somewhere with the initial width/height of the backside card and transform origins, but I can't quite get it there. What am I doing wrong?
Fiddle
https://jsfiddle.net/a9dpc05t/1/
HTML
<div class="cardWrapper">
<div class="card">
<div class="cardFace front"><img src="http://www.gannon.tv/cp_assets/3dplayingcardflip/images/hearts.png" width="129"></div>
<div class="cardFace back"><img src="http://www.gannon.tv/cp_assets/3dplayingcardflip/images/spades.png" width="129"></div>
</div>
</div>
CSS
body {
background-color: black;
margin:50px 150px;
font-family:Arial, sans-serif;
}
.cardWrapper{
width:129px;
height:200px;
position:relative;
float:left;
cursor:pointer;
}
.cardFace{
position:absolute;
width:129px;
height:200px;
overflow:hidden;
}
JavaScript
TweenLite.set(".cardWrapper", {
perspective: 800
});
TweenLite.set(".card", {
transformStyle: "preserve-3d"
});
TweenLite.set(".back", {
rotationY: -180
});
TweenLite.set([".back", ".front"], {
backfaceVisibility: "hidden"
});
$(".cardWrapper").click(
function() {
TweenLite.to($(this).find(".card"), 1.2, {
rotationY: 180,
scale: 2.48,
ease: Back.easeOut
});
}
);
EDIT V2:
Here's another version trying to fix what you specified in the comment.
jsFiddle Version 2
CODE SNIPPET V2:
TweenLite.set(".cardWrapper", {
perspective: 800
});
TweenLite.set(".card", {
transformStyle: "preserve-3d"
});
TweenLite.set(".back", {
rotationY: -180
});
TweenLite.set([".back", ".front"], {
backfaceVisibility: "hidden"
});
$(".cardWrapper").click(
function() {
TweenLite.to($(this).find(".card"), 1.2, {
rotationY: 180,
scale: 1,
ease: Back.easeOut
});
}
);
body {
background-color: black;
margin: 120px;
font-family: Arial, sans-serif;
}
.cardWrapper {
width: 387px;
height: 600px;
position: relative;
float: left;
cursor: pointer;
}
.cardFace {
position: absolute;
width: 387px;
height: auto;
overflow: hidden;
}
.cardFace img {
width: 387px;
}
.card {
transform: scale(0.248);
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.4/TweenMax.min.js"></script>
<div class="cardWrapper">
<div class="card">
<div class="cardFace front">
<img src="http://www.gannon.tv/cp_assets/3dplayingcardflip/images/hearts.png">
</div>
<div class="cardFace back">
<img src="http://www.gannon.tv/cp_assets/3dplayingcardflip/images/spades.png">
</div>
</div>
</div>
<div class="cardWrapper">
<div class="card">
<div class="cardFace front">
<img src="http://www.gannon.tv/cp_assets/3dplayingcardflip/images/hearts.png">
</div>
<div class="cardFace back">
<img src="http://www.gannon.tv/cp_assets/3dplayingcardflip/images/spades.png">
</div>
</div>
</div>
V1:
The trick is to initially scale the card down, then just apply the scale to 1 on flip.
jsFiddle
CODE SNIPPET:
TweenLite.set(".cardWrapper", {
perspective: 800
});
TweenLite.set(".card", {
transformStyle: "preserve-3d"
});
TweenLite.set(".back", {
rotationY: -180
});
TweenLite.set([".back", ".front"], {
backfaceVisibility: "hidden"
});
$(".cardWrapper").click(
function() {
TweenLite.to($(this).find(".card"), 1.2, {
rotationY: 180,
scale: 1,
ease: Back.easeOut
});
}
);
body {
background-color: black;
margin: 120px;
font-family: Arial, sans-serif;
}
.cardWrapper {
width: 144px;
height: 220px;
position: relative;
float: left;
cursor: pointer;
}
.cardFace {
position: absolute;
width: 432px;
height: 660px;
overflow: hidden;
}
.cardFace img {
width: 432px;
}
.card {
transform-origin: top right;
transform: scale(0.248);
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.4/TweenMax.min.js"></script>
<div class="cardWrapper">
<div class="card">
<div class="cardFace front">
<img src="http://www.gannon.tv/cp_assets/3dplayingcardflip/images/hearts.png">
</div>
<div class="cardFace back">
<img src="http://www.gannon.tv/cp_assets/3dplayingcardflip/images/spades.png">
</div>
</div>
</div>
You need to add margin and padding to the div. Also check for the proper size of the divs in the CSS.
For the best layout, margin should be added to .card and padding should be added to .front and .back
I also made a flipping cards layout. Check this out, it may help you. :)
http://codepen.io/aman_d1996/pen/WxJwoo
<html>
<head>
<title>Cards</title>
</head>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="https://cdn.rawgit.com/nnattawat/flip/master/dist/jquery.flip.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
<script src="main.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="style.css">
<body>
<div class="container" style="margin:auto;">
<div class="row" style="margin:3px;">
<div class="col-xs-3" id="card1" style="padding-bottom: 16.7vw;">
<div class="front" style="border-top: 3px solid #e67e22;
background: rgba(230, 126, 34, .9);">
<h4>TILE1</h4>
</div>
<div class="back" style="background: rgb(65, 72, 65);">
<h4>BACK</h4>
</div>
</div>
<div class="col-xs-3" id="card2" style="padding-bottom: 16.7vw;">
<div class="front" style="border-top: 3px solid #ffc72c;
background-color: rgba(255, 199, 44, 0.901961);">
<h4>TILE2</h4>
</div>
<div class="back" style="background: rgb(65, 72, 65);">
<h4>BACK</h4>
</div>
</div>
<div class="col-xs-6" id="card3" style="padding-bottom: 16.7vw;">
<div class="front" style="border-top: 3px solid #c98bdb;
background: rgba(201, 139, 219, .9);">
<h4>TILE3</h4>
</div>
<div class="back" style="background: rgb(65, 72, 65);">
<h4>BACK</h4>
</div>
</div>
</div>
<div class="row" style="margin:3px">
<div class="col-xs-6" id="card4" style="padding-bottom: 16.7vw;">
<div class="front" style="border-top: 3px solid #c98bdb;
background: rgba(201, 139, 219, .9);">
<h4>TILE4</h4>
</div>
<div class="back" style="background: rgb(65, 72, 65);">
<h4>BACK</h4>
</div>
</div>
<div class="col-xs-3" id="card5" style="padding-bottom: 16.7vw;">
<div class="front" style="border-top: 3px solid #ffc72c;
background-color: rgba(255, 199, 44, 0.901961);">
<h4>TILE5</h4>
</div>
<div class="back" style="background: rgb(65, 72, 65);">
<h4>BACK</h4>
</div>
</div>
<div class="col-xs-3" id="card6" style="padding-bottom: 16.7vw;">
<div class="front" style="border-top: 3px solid #e67e22;
background: rgba(230, 126, 34, .9);">
<h4>TILE6</h4>
</div>
<div class="back" style="background: rgb(65, 72, 65);">
<h4>BACK</h4>
</div>
</div>
</div>
</div>
</body>
</html>
CSS
body>div>div>div>div>h4 {
font-family: 'Roboto', sans-serif;
text-transform: uppercase;
font-size: 17px;
font-weight: bolder;
margin-left: 12px;
color: white;
}
JS
$(function($) {
$("#card1").flip({
axis: 'y',
trigger: 'click'
});
$("#card1").on('click', function(){
$("#card2").flip(false);
$("#card3").flip(false);
$("#card4").flip(false);
$("#card5").flip(false);
$("#card6").flip(false);
});
$("#card2").flip({
axis: 'y',
trigger: 'click'
});
$("#card2").on('click', function(){
$("#card1").flip(false);
$("#card3").flip(false);
$("#card4").flip(false);
$("#card5").flip(false);
$("#card6").flip(false);
});
$("#card3").flip({
axis: 'x',
trigger: 'click'
});
$("#card3").on('click', function(){
$("#card2").flip(false);
$("#card1").flip(false);
$("#card4").flip(false);
$("#card5").flip(false);
$("#card6").flip(false);
});
$("#card4").flip({
axis: 'x',
trigger: 'click'
});
$("#card4").on('click', function(){
$("#card2").flip(false);
$("#card3").flip(false);
$("#card1").flip(false);
$("#card5").flip(false);
$("#card6").flip(false);
});
$("#card5").flip({
axis: 'y',
trigger: 'click'
});
$("#card5").on('click', function(){
$("#card2").flip(false);
$("#card3").flip(false);
$("#card4").flip(false);
$("#card1").flip(false);
$("#card6").flip(false);
});
$("#card6").flip({
axis: 'y',
trigger: 'click'
});
$("#card6").on('click', function(){
$("#card2").flip(false);
$("#card3").flip(false);
$("#card4").flip(false);
$("#card5").flip(false);
$("#card1").flip(false);
});
});
Related
I'm writing a homepage for my business website. I encountered a problem after inserting a second Owl Carousel. The second slider is showing up fine but first one somehow disappeared. When I removed the second Carousel, the first one came back. I figured it has to do with giving the divs specific IDs or classes but no matter how I tried I can't seem to make them work.
I tried giving them specific class such as
div class="owl-one owl-carousel owl-theme" and div class="owl-two owl-carousel owl-theme"
As well as ids
div id="owl-one" class="owl-carousel owl-theme"
and div id="owl-two" class="owl-carousel owl-theme"
And changed the script to
$('.owl-one .owl-slideImg .owl-theme').owlCarousel({
$('.owl-two .owl-carousel').owlCarousel({
As well as
$('#owl-one .owl-slideImg .owl-theme').owlCarousel({
$('#owl-two .owl-carousel').owlCarousel({
What am I doing wrong? Please help!
Here is the first slider code:
<!DOCTYPE html>
<link rel="stylesheet" href="https://cdn.shopify.com/s/files/1/0609/1436/8761/t/6/assets/bootstrap-grid.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.theme.default.css">
<style>
.owl-slideImg .owl-nav div{
position: absolute !important;
width: 25px !important;
height: 25px !important;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
top: 40%;
}
.owl-slideImg .owl-prev {
left: -55px;
opacity: .65;
background: url(https://www.panpuri.com/asset/frontend/images/right-chevron.svg) !important;
background-position: center !important;
background-repeat: no-repeat !important;
background-size: 20px 20px !important;
transform: rotate(180deg);
color: rgba(0, 0, 0, 0) !important;
transition: .33s all ease-out;
}
.owl-slideImg .owl-next {
right: -55px;
opacity: .65;
background: url(https://www.panpuri.com/asset/frontend/images/right-chevron.svg) !important;
background-position: center !important;
background-repeat: no-repeat !important;
background-size: 20px 20px !important;
color: rgba(0, 0, 0, 0) !important;
transition: .33s all ease-out;
}
.owl-slideImg .owl-prev:hover{
opacity: 1;
}
.owl-slideImg .owl-next:hover{
opacity: 1;
}
#media only screen and (max-width: 991px) { /* MOBILE */
.owl-slideImg .slide-img{
height: 250px;
background-position: center !important;
background-repeat: no-repeat !important;
background-size: 100% auto !important;
}
.owl-slideImg .slide-box-text div{
padding: 40px;
}
.owl-slideImg .box-icon-svg{
display: flex;
justify-content: end;
}
.box-icon-svg img{
max-width: 30px;
}
.container-fluid{
padding-bottom: 20rem;
margin-bottom: 20rem;
}
.owl-slideImg .owl-nav div{
top: 20%;
}
.owl-slideImg .owl-prev {
left: 0 !important;
}
.owl-slideImg .owl-next {
right: 0 !important;
}
}
#media only screen and (min-width: 992px) { /* PC */
.owl-slideImg .slide-box-text{
height:100%;
display: flex;
justify-content: center;
justify-items: center;
align-items: center;
width:100%;
}
.owl-slideImg .slide-img{
height: 350px;
background-position: center !important;
background-repeat: no-repeat !important;
background-size: 100% auto !important;
}
.owl-slideImg .slide-box-text div{
width: 60%;
}
.owl-slideImg .box-icon-svg{
position: absolute;
right: 0;
bottom: 0;
display: flex;
margin-right: 40px;
margin-bottom: 20px;
}
.box-icon-svg img{
max-width: 60px !important;
margin-top: -20px;
}
.owl-slideImg .owl-item{
width: 100%;
}
.service-header{
text-align: center;
justify-content: center;
}
.container-fluid{
padding-bottom: 20rem;
margin-bottom: 20rem;
}
}
</style>
<main>
<br>
<br>
<br>
<h2 class="service-header">our service</h2>
<div class="col p-5">
<div class="row justify-content-center">
<div class="col-xl-8 col-lg-10 col-12 owl-slideImg ">
<div class="owl-carousel owl-theme">
<div class="owl-item">
<div class="row">
<div class="col-xl-6 col-12 slide-img" style="background: url(https://cdn.shopify.com/s/files/1/0609/1436/8761/files/Installation_0702da65-4ad7-42df-9ea6-bca10d7c541a.jpg);"> </div>
<div class="col-xl-6 col-12">
<div class="slide-box-text">
<div>
Given our versatility and neat craftsmanship in stone installation, we have been providing our service to various leading construction and estate companies in Thailand.
</div>
</div>
<div class="box-icon-svg">
<h3 class="mr-3">installation</h3>
<img src="https://cdn.shopify.com/s/files/1/0609/1436/8761/t/6/assets/Installicon.svg?v=1646822679" alt="">
</div>
</div>
</div>
</div>
<div class="owl-item">
<div class="row">
<div class="col-xl-6 col-12 slide-img" style="background: url(https://cdn.shopify.com/s/files/1/0609/1436/8761/files/Supply.jpg);"> </div>
<div class="col-xl-6 col-12">
<div class="slide-box-text">
<div>
With connections and credible sources from both domestic and oversea quarries, we can supply great quality stones that meet your needs and specifications.
</div>
</div>
<div class="box-icon-svg">
<h3 class="mr-3">supply</h3>
<img src="https://cdn.shopify.com/s/files/1/0609/1436/8761/t/6/assets/Supplyicon.svg?v=1646822694" alt="">
</div>
</div>
</div>
</div>
<div class="owl-item">
<div class="row">
<div class="col-xl-6 col-12 slide-img" style="background: url(https://cdn.shopify.com/s/files/1/0609/1436/8761/files/Restore.jpg);"> </div>
<div class="col-xl-6 col-12">
<div class="slide-box-text">
<div>
We let our designers draft up a digital rendered image beforehand for any customisation and specifications such as landscaping and counter tops.
</div>
</div>
<div class="box-icon-svg">
<h3 class="mr-3">design</h3>
<img src="https://cdn.shopify.com/s/files/1/0609/1436/8761/t/6/assets/Designicon.svg?v=1646822671" alt="">
</div>
</div>
</div>
</div>
<div class="owl-item">
<div class="row">
<div class="col-xl-6 col-12 slide-img" style="background: url(https://cdn.shopify.com/s/files/1/0609/1436/8761/files/Design.jpg);"> </div>
<div class="col-xl-6 col-12">
<div class="slide-box-text">
<div>
With high quality machines, we can provide any finishing and resurfacing process including polishing and honing.
</div>
</div>
<div class="box-icon-svg">
<h3 class="mr-3">restore</h3>
<img src="https://cdn.shopify.com/s/files/1/0609/1436/8761/t/6/assets/Restoreicon.svg?v=1646822686" alt="">
</div>
</div>
</div>
</div>
</div>
</div>
<br>
</div>
</div>
</main>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js#1.16.0/dist/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.2.1/owl.carousel.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$(".owl-slideImg .owl-theme").owlCarousel({
center: false,
loop: true,
autoplay: true,
autoplayTimeout: 50000,
nav: true,
dots: true,
items: 1,
margin: 40
});
});
</script>
And this is the second slider code:
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css" integrity="sha512-tS3S5qG0BlhnQROyJXvNjeEM4UpMXHrQfTGmbQ1gKmelCxlSEBUaxhRBj/EFTzpbP4RVSrpEikbmdJobCvhE3g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.theme.default.min.css" integrity="sha512-sMXtMNL1zRzolHYKEujM2AqCLUR9F2C4/05cdbxjjLSRvMQIciEPCQZo++nk7go3BtSuK9kfa/s+a4f4i5pLkw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
<body>
<br>
<div class="logoslider">
<div class="owl-carousel owl-theme">
<div class="item">
<img src="https://cdn.shopify.com/s/files/1/0609/1436/8761/files/G1_Client-Logo5.jpg" alt="The Ritz Carlton">
</div>
<div class="item">
<img src="https://cdn.shopify.com/s/files/1/0609/1436/8761/files/G1_Client-Logo2.jpg" alt="Phulaybay">
</div>
<div class="item">
<img src="https://cdn.shopify.com/s/files/1/0609/1436/8761/files/G1_Client-Logo6.jpg" alt="Silpakorn">
</div>
<div class="item">
<img src="https://cdn.shopify.com/s/files/1/0609/1436/8761/files/G1_Client-Logo3.jpg" alt="Property Perfect">
</div>
<div class="item">
<img src="https://cdn.shopify.com/s/files/1/0609/1436/8761/files/G1_Client-Logo1.jpg" alt="Thames Valley">
</div>
<div class="item">
<img src="https://cdn.shopify.com/s/files/1/0609/1436/8761/files/G1_Client-Logo4.jpg" alt="The Mall Group">
</div>
<div class="item">
<img src="https://cdn.shopify.com/s/files/1/0609/1436/8761/files/G1_Client-Logo7.jpg" alt="Pirom At Vineyard">
</div>
<div class="item">
<img src="https://cdn.shopify.com/s/files/1/0609/1436/8761/files/G1_Client-Logo8.jpg" alt="NYE Estate">
</div>
<div class="item">
<img src="https://cdn.shopify.com/s/files/1/0609/1436/8761/files/G1_Client-Logo13.jpg" alt="Balcony Thailand">
</div>
<div class="item">
<img src="https://cdn.shopify.com/s/files/1/0609/1436/8761/files/G1_Client-Logo10.jpg" alt="Harbor Laemchabang">
</div>
<div class="item">
<img src="https://cdn.shopify.com/s/files/1/0609/1436/8761/files/G1_Client-Logo12.jpg" alt="Belle Rama 9">
</div>
<div class="item">
<img src="https://cdn.shopify.com/s/files/1/0609/1436/8761/files/G1_Client-Logo9.jpg" alt="Major Development">
</div>
<div class="item">
<img src="https://cdn.shopify.com/s/files/1/0609/1436/8761/files/G1_Client-Logo11.jpg" alt="Gazebo Garden">
</div>
<div class="item">
<img src="https://cdn.shopify.com/s/files/1/0609/1436/8761/files/G1_Client-Logo15.jpg" alt="360 Pano">
</div>
<div class="item">
<img src="https://cdn.shopify.com/s/files/1/0609/1436/8761/files/G1_Client-Logo14.jpg" alt="Anantarakiri">
</div>
</div>
</div>
<br>
<br>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js" integrity="sha512-bPs7Ae6pVvhOSiIcyUClR7/q2OAsRiovw4vAkX+zJbw3ShAeeqezq50RIIcIURq7Oa20rW2n2q+fyXBNcU9lrw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script type="text/javascript">
$('.owl-carousel').owlCarousel({
loop: true,
autoplay: true,
nav: false,
dots: false,
margin: 40,
autoplayTimeout: 1500,
responsive:{
0:{
items:4
},
600:{
items:8
},
1000:{
items:8
}
}
})
</script>
</body>
<style>
.logoslider{
display: flex;
width: 80%;
justify-content: center;
justify-items: center;
align-items: center;
margin-left: auto;
margin-right: auto;
}
</style>
Try like this
Owl Carousel One
var owl_carousel_one = $('.owl-carousel-one');
owl_carousel_one.owlCarousel({
loop: true,
margin: 30,
autoplay: true,
autoplayTimeout: 5000,
autoplayHoverPause: true,
smartSpeed: 1000,
responsive: {
0: {
items: 4
},
600: {
items: 8
},
1000: {
items: 8
}
}
});
Owl Carousel Two
var owl_carousel_two = $('.owl-carousel-two');
owl_carousel_two.owlCarousel({
loop: true,
margin: 30,
autoplay: true,
autoplayTimeout: 5000,
autoplayHoverPause: true,
smartSpeed: 1000,
responsive: {
0: {
items: 4
},
600: {
items: 8
},
1000: {
items: 8
}
}
});
Just use these unique classes (.owl-carousel-one, .owl-carousel-two, and so on...) for each owl carousel HTML element. No need for any ID.
I have vertical photo sliding carousel ( using slick ) in my website. I want to change the default arrows of the slick which are pointing left and right and want to add up and down arrows. I did it using JS. prevArrow: $('.prev'),
nextArrow: $('.next').
Want nav arrows to attach to the top and bottom in all sizes of the card above the slider
Codepen Link
$('.slick', '.vertical-slider').slick({
vertical: true,
verticalSwiping: true,
autoplay: true,
autoplaySpeed: 5000,
slidesToShow: 4,
slidesToScroll: 1,
prevArrow: $('.prev'),
nextArrow: $('.next')
});
.row {
height: 423px;
}
.map {
background-color: blue;
}
.des {
background-color: #88206d;
}
.image-slide {
background-color: #88206d;
}
.slick-slide img {
width: 100%;
}
.vertical-slider {
padding-right: 0 !important;
height: 100%;
}
.slick img {
box-shadow: 6px 6px 9px 0px rgba(0, 0, 0, 0.5);
-webkit-box-shadow: 6px 6px 9px 0px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 6px 6px 9px 0px rgba(0, 0, 0, 0.5);
}
.image-nav {
z-index: 1;
cursor: pointer;
}
.nav-height {
height: 423px;
}
.slick .slick-prev::before {
/* content: url(https://i.stack.imgur.com/NEpWE.png); */
}
.slick .slick-next::before {
/* content: url(https://i.stack.imgur.com/dBFSB.png); */
}
.slick-prev,
.slick-next {
/* position: static!important;
width: auto!important;
height: auto!important; */
/* left:31%!important; */
}
.slick-prev {
/* top:0!important; */
}
.slick-next {
/* top:100%!important; */
}
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css'>
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/slick-carousel#1.8.1/slick/slick.css'>
<link rel='stylesheet' href='https://cdn.jsdelivr.net/gh/kenwheeler/slick#1.8.1/slick/slick-theme.css'>
<link rel="stylesheet" href="./style.css">
<div class="container">
<div class="row rounded shadow mt-5">
<div class="col-5 map">
<h1 class="text-light">Map</h1>
</div>
<div class="col-2 image-slide">
<!-- image slider -->
<div class="image-nav position-relative d-flex justify-content-center">
<div class="nav-height position-absolute d-flex flex-column justify-content-between">
<div class="prev"><span><img src="https://i.stack.imgur.com/NEpWE.png" alt=""></span></div>
<div class="next"><span><img src="https://i.stack.imgur.com/dBFSB.png" alt=""></span></div>
</div>
</div>
<div class="slider vertical-slider my-auto">
<div class="slick">
<!-- single image to copy for slide -->
<div class="item my-1">
<img src="https://i.ibb.co/jWV74db/best-nata-coaching-center.jpg" />
</div>
<div class="item my-1">
<img src="https://i.ibb.co/jWV74db/best-nata-coaching-center.jpg" />
</div>
<div class="item my-1">
<img src="https://i.ibb.co/jWV74db/best-nata-coaching-center.jpg" />
</div>
<div class="item my-1">
<img src="https://i.ibb.co/jWV74db/best-nata-coaching-center.jpg" />
</div>
<div class="item my-1">
<img src="https://i.ibb.co/jWV74db/best-nata-coaching-center.jpg" />
</div>
</div>
</div>
</div>
<div class="col-5 des">
<h1 class="text-light">Description</h1>
</div>
</div>
</div>
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.0/js/bootstrap.min.js'></script>
<script src='https://cdn.jsdelivr.net/npm/slick-carousel#1.8.1/slick/slick.min.js'></script>
<script src="./script.js"></script>
You can rotate the pseudo elements with CSS transform like this:
.slick .slick-prev::before,
.slick .slick-next::before {
display: block;
transform: rotate(90deg);
}
$('.slick', '.vertical-slider').slick({
vertical: true,
verticalSwiping: true,
autoplay: true,
autoplaySpeed: 5000,
slidesToShow: 4,
slidesToScroll: 1,
responsive: [{
breakpoint: 992,
settings: {
slidesToShow: 3,
slidesToScroll: 1
}
}]
});
.row {
height: 423px;
}
.map {
background-color: blue;
}
.des {
background-color: red;
}
.image-slide {
background-color: red;
}
.slick-slide img {
width: 100%;
}
.vertical-slider {
height: 100%;
padding-right: 0 !important;
}
.slick img {
box-shadow: 6px 6px 9px 0px rgba(0, 0, 0, 0.5);
-webkit-box-shadow: 6px 6px 9px 0px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 6px 6px 9px 0px rgba(0, 0, 0, 0.5);
}
.slick .slick-prev {
background: url(/assets/img/nav/nav-try.svg) no-repeat scroll 15px -5px;
left: -25px;
padding: 24px;
}
.slick .slick-next {
background: url(/assets/img/nav/nav-try.svg) no-repeat scroll -30px -5px;
right: -28px;
padding: 24px;
}
.slick .slick-prev::before,
.slick .slick-next::before {
display: block;
transform: rotate(90deg);
}
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css'>
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/slick-carousel#1.8.1/slick/slick.css'>
<link rel='stylesheet' href='https://cdn.jsdelivr.net/gh/kenwheeler/slick#1.8.1/slick/slick-theme.css'>
<link rel="stylesheet" href="./style.css">
</head>
<body>
<!-- partial:index.partial.html -->
<div class="container">
<div class="row rounded shadow mt-5">
<div class="col-5 map">
<h1 class="text-light">Map</h1>
</div>
<div class="col-2 image-slide">
<!-- image slider -->
<div class="slider vertical-slider my-auto">
<div class="slick">
<!-- single image to copy for slide -->
<div class="item my-2 px-3">
<img src="https://i.ibb.co/jWV74db/best-nata-coaching-center.jpg" />
</div>
<div class="item my-2 px-3">
<img src="https://i.ibb.co/jWV74db/best-nata-coaching-center.jpg" />
</div>
<div class="item my-2 px-3">
<img src="https://i.ibb.co/jWV74db/best-nata-coaching-center.jpg" />
</div>
<div class="item my-2 px-3">
<img src="https://i.ibb.co/jWV74db/best-nata-coaching-center.jpg" />
</div>
<div class="item my-2 px-3">
<img src="https://i.ibb.co/jWV74db/best-nata-coaching-center.jpg" />
</div>
</div>
</div>
</div>
<div class="col-5 des">
<h1 class="text-light">Description</h1>
</div>
</div>
</div>
<!-- partial -->
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.0/js/bootstrap.min.js'></script>
<script src='https://cdn.jsdelivr.net/npm/slick-carousel#1.8.1/slick/slick.min.js'></script>
<script src="./script.js"></script>
<div style="width:320px">
<div class="menu-name owl-carousel owl-theme">
<div class="item">
<div class="name quicksand aktip" id="one">Profile</div>
</div>
<div class="item">
<div class="name quicksand aktip" id="two">About us</div>
</div>
</div>
</div>
JS
var $owl = $('.owl-carousel');
$owl.owlCarousel({
center: false,
margin: 0,
autoWidth:true,
});
I have problem when I write About us will be two line. and when I write About is that what I need, one line. I want to keep writing about us and one line
here is my full code https://jsfiddle.net/dedi_wibisono17/0npx9g15/18/
Is this what you want?
I removed
center: false,
autoWidth:true,
from
$owl.owlCarousel({
margin: 0,
});
var $owl = $('.owl-carousel');
$owl.owlCarousel({
margin: 0,
});
$('.owl-carousel').on('click', '.owl-item.active', function(e) {
var carousel = $('.owl-carousel').data('owl.carousel');
e.preventDefault();
carousel.to(carousel.relative($(this).index()), false, true);
});
//add class aktip
$(".name").click(function(e) {
var id = $(this).attr("id");
var toShow = '#show-' + id;
$(".name").removeClass("aktip");
$(this).addClass("aktip")
$(".isi-content").not(toShow).hide();
$(toShow).fadeIn();
});
.menu-name {
background: tomato;
color: white;
border-bottom: 2px solid #eaeaea;
overflow-x: auto;
white-space: nowrap;
}
.name {
border: 1px solid white;
padding: 10px;
cursor: pointer;
margin: 8px;
transition: margin 0.4s ease;
}
.aktip {
background: orange;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js"></script>
<div style="width:320px">
<div class="menu-name owl-carousel owl-theme">
<div class="item">
<div class="name quicksand aktip" id="one">Profile</div>
</div>
<div class="item">
<div class="name quicksand" id="two">About Us</div>
</div>
<div class="item">
<div class="name quicksand" id="three">Gallery</div>
</div>
<div class="item">
<div class="name quicksand" id="four">Contact</div>
</div>
<div class="item">
<div class="name quicksand" id="five">Details</div>
</div>
</div>
</div>
Is it possible to target specific Slick Carousel arrows? I'm building a table with 3 columns running as a carousel and would like to delete the remaining prev/next arrows.
Here is an example:
When you run the code snippet below, please expand it to 'full page' for best results.
Thanks so much in advance!
Here is what I currently have setup:
.heading {
background-color: #00C6D7;
}
.sub-heading {
background-color: white;
border-bottom: 1px solid lightgray;
}
h4, h6 {
margin-bottom: 0px;
}
.container {
box-shadow: 0 1px 3px rgba(77,72,69,0.2), 0 6px 10px rgba(77,72,69,0.15);
}
.row > .col-md-12 > span {
font-size: smaller;
}
.col-md-4 {
padding-top: .6rem!important;
padding-bottom: .6rem!important;
}
.col-md-3 {
padding-top: .6rem!important;
padding-bottom: .6rem!important;
}
.col-md-2 {
display: flex;
justify-content: center;
align-items: center;
}
.col-md-9 {
padding: 0px!important;
}
.bl {
border-left: 1px solid lightgray;
}
.bb {
border-bottom: 1px solid #00C6D7;
}
.bg-white {
background-color: white;
}
.mainText {
font-style: italic;
color: #00C6D7;
}
.bg-fhdark {
background-color: #5E6A71;
}
.title {
color: #A2AD00;
}
.blank {
background: transparent!important;
}
.slick-prev, .slick-next {
background: black!important;
}
.r1 {
color: black;
}
/* BootStrap 4 Classes */
.py-5 {
padding-bottom: 3rem!important;
padding-top: 3rem!important;
}
.py-2 {
padding-bottom: .5rem!important;
padding-top: .5rem!important;
}
.text-white {
color: #fff!important;
}
.text-left {
text-align: left!important;
}
.text-uppercase {
text-transform: uppercase!important;
}
.font-weight-bold {
font-weight: 700!important;
}
.small {
font-size: 80%;
font-weight: 400;
}
.row {
display: flex;
flex-wrap: wrap;
}
.row-11 {
height: auto!important;
}
/* ----- */
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"> -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.9.0/slick.css"/>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.9.0/slick-theme.css"/>
</head>
<body>
<div class="py-5">
<div class="container">
<div class="row">
<div class="col-md-10 text-white text-left py-2 heading">
<h4 class="text-uppercase font-weight-bold">Core Competencies</h4>
<p>Our goal was to develop a set of core competencies that are consistent across the agency amd reflect growth as a priority.
Some competencies, such as negotiating, listening and interpersonal communication are not included but are considered baseline skills.
The Core Competencies consist of four main areas: Client, Talent, Business Development and Growth, and Finance and Operations.
Each area is outlined at the junior, mid and senior level.
</p>
</div>
<div class="col-md-2 text-center py-2 heading">
</div>
</div>
<div class="row">
<div class="col-md-3">Test</div>
<div class="col-md-9">
<section class="regular slider">
<div class="col-md-4">
<h6 class="text-uppercase font-weight-bold title">Junior</h6>
<span>Valued Colleague and Practitioner</span>
</div>
<div class="col-md-4">
<h6 class="text-uppercase font-weight-bold title">Mid</h6>
<span>Trusted Colleague; Proven and Creative Practitioner</span>
</div>
<div class="col-md-4">
<h6 class="text-uppercase font-weight-bold title">Senior</h6>
<span>Trusted Client Advisor and Partner; Proven Agency Leader</span>
</div>
</section>
</div>
</div>
<div class="row">
<div class="col-md-3 bg-fhdark">
<span class="text-uppercase font-weight-bold text-white">Client</span>
</div>
<div class="col-md-9 bg-fhdark">
<div class="col-md-4"></div>
<div class="col-md-4"></div>
<div class="col-md-4"></div>
</div>
</div>
<div class="row">
<div class="col-md-3 bb">
<span>Client Focus, Strategic Counsel and Consultancy</span>
</div>
<div class="col-md-9 bb">
<section class="regular slider">
<div class="col-md-4">1</div>
<div class="col-md-4">1</div>
<div class="col-md-4">1</div>
</section>
</div>
</div>
<div class="row">
<div class="col-md-3">
<span>Integrated Strategy and Account Management</span>
</div>
<div class="col-md-9">
<section class="regular slider">
<div class="col-md-4">2</div>
<div class="col-md-4">2</div>
<div class="col-md-4">2</div>
</section>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="https://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.9.0/slick.min.js"></script>
<script type="text/javascript">
$(function() {
$(".regular").slick({
dots: false,
infinite: false,
slidesToShow: 2,
slidesToScroll: 1,
asNavFor: '.slider',
});
});
</script>
</body>
</html>
When your slider runs, the arrows are represented with the classes .slick-next and .slick-prev
From there, your solution should just be an easy CSS solution. You can add a class or id to differentiate the main slider from the others.
I think an elegant solution would be to put a class called .no-arrows on your sliders that don't need arrows, and then use a CSS selector to hide its arrows:
.no-arrows .slick-next,
.no-arrows .slick-prev {
display: none;
}
Here's a demo:
.heading {
background-color: #00C6D7;
}
.sub-heading {
background-color: white;
border-bottom: 1px solid lightgray;
}
h4, h6 {
margin-bottom: 0px;
}
.container {
box-shadow: 0 1px 3px rgba(77,72,69,0.2), 0 6px 10px rgba(77,72,69,0.15);
}
.row > .col-md-12 > span {
font-size: smaller;
}
.col-md-4 {
padding-top: .6rem!important;
padding-bottom: .6rem!important;
}
.col-md-3 {
padding-top: .6rem!important;
padding-bottom: .6rem!important;
}
.col-md-2 {
display: flex;
justify-content: center;
align-items: center;
}
.col-md-9 {
padding: 0px!important;
}
.bl {
border-left: 1px solid lightgray;
}
.bb {
border-bottom: 1px solid #00C6D7;
}
.bg-white {
background-color: white;
}
.mainText {
font-style: italic;
color: #00C6D7;
}
.bg-fhdark {
background-color: #5E6A71;
}
.title {
color: #A2AD00;
}
.blank {
background: transparent!important;
}
.slick-prev, .slick-next {
background: black!important;
}
.no-arrows .slick-next,
.no-arrows .slick-prev {
display: none!important;
}
.r1 {
color: black;
}
/* BootStrap 4 Classes */
.py-5 {
padding-bottom: 3rem!important;
padding-top: 3rem!important;
}
.py-2 {
padding-bottom: .5rem!important;
padding-top: .5rem!important;
}
.text-white {
color: #fff!important;
}
.text-left {
text-align: left!important;
}
.text-uppercase {
text-transform: uppercase!important;
}
.font-weight-bold {
font-weight: 700!important;
}
.small {
font-size: 80%;
font-weight: 400;
}
.row {
display: flex;
flex-wrap: wrap;
}
.row-11 {
height: auto!important;
}
/* ----- */
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"> -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.9.0/slick.css"/>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.9.0/slick-theme.css"/>
</head>
<body>
<div class="py-5">
<div class="container">
<div class="row">
<div class="col-md-10 text-white text-left py-2 heading">
<h4 class="text-uppercase font-weight-bold">Core Competencies</h4>
<p>Our goal was to develop a set of core competencies that are consistent across the agency amd reflect growth as a priority.
Some competencies, such as negotiating, listening and interpersonal communication are not included but are considered baseline skills.
The Core Competencies consist of four main areas: Client, Talent, Business Development and Growth, and Finance and Operations.
Each area is outlined at the junior, mid and senior level.
</p>
</div>
<div class="col-md-2 text-center py-2 heading">
</div>
</div>
<div class="row">
<div class="col-md-3">Test</div>
<div class="col-md-9">
<section class="regular slider">
<div class="col-md-4">
<h6 class="text-uppercase font-weight-bold title">Junior</h6>
<span>Valued Colleague and Practitioner</span>
</div>
<div class="col-md-4">
<h6 class="text-uppercase font-weight-bold title">Mid</h6>
<span>Trusted Colleague; Proven and Creative Practitioner</span>
</div>
<div class="col-md-4">
<h6 class="text-uppercase font-weight-bold title">Senior</h6>
<span>Trusted Client Advisor and Partner; Proven Agency Leader</span>
</div>
</section>
</div>
</div>
<div class="row">
<div class="col-md-3 bg-fhdark">
<span class="text-uppercase font-weight-bold text-white">Client</span>
</div>
<div class="col-md-9 bg-fhdark">
<div class="col-md-4"></div>
<div class="col-md-4"></div>
<div class="col-md-4"></div>
</div>
</div>
<div class="row">
<div class="col-md-3 bb">
<span>Client Focus, Strategic Counsel and Consultancy</span>
</div>
<div class="col-md-9 bb">
<section class="regular slider no-arrows">
<div class="col-md-4">1</div>
<div class="col-md-4">1</div>
<div class="col-md-4">1</div>
</section>
</div>
</div>
<div class="row">
<div class="col-md-3">
<span>Integrated Strategy and Account Management</span>
</div>
<div class="col-md-9">
<section class="regular slider no-arrows">
<div class="col-md-4">2</div>
<div class="col-md-4">2</div>
<div class="col-md-4">2</div>
</section>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="https://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.9.0/slick.min.js"></script>
<script type="text/javascript">
$(function() {
$(".regular").slick({
dots: false,
infinite: false,
slidesToShow: 2,
slidesToScroll: 1,
asNavFor: '.slider',
});
});
</script>
</body>
</html>
I add slider-main class to the first slider, that I use to select sliders that needed to disable arrows, and using slider method $(slider).slick('slickSetOption', 'option', value, refresh); did update arrows value...
.heading {
background-color: #00C6D7;
}
.sub-heading {
background-color: white;
border-bottom: 1px solid lightgray;
}
h4, h6 {
margin-bottom: 0px;
}
.container {
box-shadow: 0 1px 3px rgba(77,72,69,0.2), 0 6px 10px rgba(77,72,69,0.15);
}
.row > .col-md-12 > span {
font-size: smaller;
}
.col-md-4 {
padding-top: .6rem!important;
padding-bottom: .6rem!important;
}
.col-md-3 {
padding-top: .6rem!important;
padding-bottom: .6rem!important;
}
.col-md-2 {
display: flex;
justify-content: center;
align-items: center;
}
.col-md-9 {
padding: 0px!important;
}
.bl {
border-left: 1px solid lightgray;
}
.bb {
border-bottom: 1px solid #00C6D7;
}
.bg-white {
background-color: white;
}
.mainText {
font-style: italic;
color: #00C6D7;
}
.bg-fhdark {
background-color: #5E6A71;
}
.title {
color: #A2AD00;
}
.blank {
background: transparent!important;
}
.slick-prev, .slick-next {
background: black!important;
}
.r1 {
color: black;
}
/* BootStrap 4 Classes */
.py-5 {
padding-bottom: 3rem!important;
padding-top: 3rem!important;
}
.py-2 {
padding-bottom: .5rem!important;
padding-top: .5rem!important;
}
.text-white {
color: #fff!important;
}
.text-left {
text-align: left!important;
}
.text-uppercase {
text-transform: uppercase!important;
}
.font-weight-bold {
font-weight: 700!important;
}
.small {
font-size: 80%;
font-weight: 400;
}
.row {
display: flex;
flex-wrap: wrap;
}
.row-11 {
height: auto!important;
}
/* ----- */
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"> -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.9.0/slick.css"/>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.9.0/slick-theme.css"/>
</head>
<body>
<div class="py-5">
<div class="container">
<div class="row">
<div class="col-md-10 text-white text-left py-2 heading">
<h4 class="text-uppercase font-weight-bold">Core Competencies</h4>
<p>Our goal was to develop a set of core competencies that are consistent across the agency amd reflect growth as a priority.
Some competencies, such as negotiating, listening and interpersonal communication are not included but are considered baseline skills.
The Core Competencies consist of four main areas: Client, Talent, Business Development and Growth, and Finance and Operations.
Each area is outlined at the junior, mid and senior level.
</p>
</div>
<div class="col-md-2 text-center py-2 heading">
</div>
</div>
<div class="row">
<div class="col-md-3">Test</div>
<div class="col-md-9">
<section class="regular slider slider-main">
<div class="col-sm-4">
<h6 class="text-uppercase font-weight-bold title">Junior</h6>
<span>Valued Colleague and Practitioner</span>
</div>
<div class="col-sm-4">
<h6 class="text-uppercase font-weight-bold title">Mid</h6>
<span>Trusted Colleague; Proven and Creative Practitioner</span>
</div>
<div class="col-sm-4">
<h6 class="text-uppercase font-weight-bold title">Senior</h6>
<span>Trusted Client Advisor and Partner; Proven Agency Leader</span>
</div>
</section>
</div>
</div>
<div class="row">
<div class="col-md-3 bg-fhdark">
<span class="text-uppercase font-weight-bold text-white">Client</span>
</div>
<div class="col-md-9 bg-fhdark">
<div class="col-md-4"></div>
<div class="col-md-4"></div>
<div class="col-md-4"></div>
</div>
</div>
<div class="row">
<div class="col-md-3 bb">
<span>Client Focus, Strategic Counsel and Consultancy</span>
</div>
<div class="col-md-9 bb">
<section class="regular slider">
<div class="col-md-4">1</div>
<div class="col-md-4">1</div>
<div class="col-md-4">1</div>
</section>
</div>
</div>
<div class="row">
<div class="col-md-3">
<span>Integrated Strategy and Account Management</span>
</div>
<div class="col-md-9">
<section class="regular slider">
<div class="col-md-4">2</div>
<div class="col-md-4">2</div>
<div class="col-md-4">2</div>
</section>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="https://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.9.0/slick.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$(".regular").slick({
dots: false,
infinite: false,
slidesToShow: 2,
slidesToScroll: 1,
asNavFor: '.slider',
});
$('.slider:not(.slider-main)').slick('slickSetOption', 'arrows', false, true);
});
</script>
</body>
</html>
I'm using the jQuery Flip Plugin. I'm trying to have a couple of cards on top of each other and when the user clicks on a card, it should turn and show the backside. But now only the text is flipping and not the card behind the text. I managed to have it wokring before, but I had to make classes for front and back.
$(function() {
$(".card").flip({
axis: "y",
reverse: "false",
trigger: "click",
speed: 700,
});
});
.card {
position: absolute;
width: 400px;
height: 248px;
margin: 2px;
background-color: #F3ECE2;
border: 5px blue solid;
padding: 10px;
border-radius: 25px;
}
#card-1 {
left: 0px;
top: 0px;
z-index: 1;
}
#card-2 {
left: 10px;
top: -238px;
z-index: 2;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.rawgit.com/nnattawat/flip/v1.0.16/dist/jquery.flip.min.js"></script>
<div class="card" id="card-1">
<div>
Front1
</div>
<div>
Back1
</div>
</div>
<div class="card" id="card-2">
<div>
Front2
</div>
<div>
Back2"
</div>
</div>
From my understanding of the website, you need to add front and back classes to the corresponding div's, as shown:
$(function() {
$(".card").flip({
axis: "y",
reverse: "false",
trigger: "click",
speed: 700,
});
});
.card{
width:200px;
height:100px;
position:relative;
}
.front,
.back {
background-color: #F3ECE2;
border: 5px blue solid;
padding: 10px;
border-radius: 25px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.rawgit.com/nnattawat/flip/v1.0.16/dist/jquery.flip.min.js"></script>
<div class="card" id="card-1">
<div class="front">
Front1
</div>
<div class="back">
Back1
</div>
</div>
<div class="card" id="card-2">
<div class="front">
Front2
</div>
<div class="back">
Back2
</div>
</div>