The carousel in the Project file seems to be malfunctioning

Having previously utilized Owl carousel on my website, I made the switch to slick carousel for the slider on a NATA coaching center in Chennai. Unfortunately, I'm encountering issues with getting the slider to work and I'm unsure of where I may be making mistakes. All images are currently displayed in a flex-column format, but I desire it to resemble a vertical slider. Below is an example of how I envision it:

https://i.sstatic.net/HGiBN.png

To achieve a vertical slider using slick, you can refer to this Codepen.

$(document).ready(function(){

$('.items').slick({
infinite: true,
slidesToShow: 3,
slidesToScroll: 3
});
});
.contact-card {
background-color: #88206D;
border: solid 2px #fff;
border-radius: 21px;
min-height: 406px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
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);
}

#google-icon img {
height: 44px;
z-index: 1000;
background-color: #fff;
padding: 5px;
border-radius: 22px;
box-shadow: 2px 2px 6px 0px rgba(0, 0, 0, 0.53);
-webkit-box-shadow: 2px 2px 6px 0px rgba(0, 0, 0, 0.53);
-moz-box-shadow: 2px 2px 6px 0px rgba(0, 0, 0, 0.53);
margin-top: 24px;
margin-bottom: 60px;
}

.google-review {
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-o-transform: rotate(90deg);
margin-bottom: 60px;
}

.col-1 {
display: flex;
flex-direction: column;
align-items: center;
}
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="87f4ebeee4ecaae4e6f5e8f2f4e2ebc7b6a9bfa9b6">[email protected]</a>/slick/slick.css" rel="stylesheet"/>
<link href="https://cdn.jsdelivr.net/gh/kenwheeler/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="99eaf5f0faf2d9a8b7a1b7a8">[email protected]</a>/slick/slick-theme.css" rel="stylesheet"/>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="40332c29232b6d2321322f3533252c00716e786e71">[email protected]</a>/slick/slick.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet" />
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<main>
<div class="container">
<div class="row contact-card">
<div class="map col-5" id="map"></div>
<div class="offset-2 image-scroll"></div>
<div class="map-des col-3 text-white my-auto pt-4" id="m-des"></div>

<!-- i struggle in this part -- >

<!-- google reviews -->
<div class="col-1 text-center">
<div id="google-icon">
<img src="https://i.ibb.co/nknMt4k/search.png" class="google-icon">
</div>


<div class="side-star">
<p class="google-review text-nowrap">
Special thanks to  Julie Porosky from Ironistic!
</div>
</div>
</div>

<!—Struggling here —>

  </div>;
    </div>;             
            <div >
              <h1>This is a test</h1>  
          </div> 
 
        </div> 
   </div>


          Code:
          <div > do something <
          
    </div>



</section_20_open>
        
      <div class="container-open-left-sidebar-close wantItLeft"-->
      
           notice close message
        
                   same thing 

                   ok two done


                    
</storyittle_info_plate-->

Answer №1

To implement this code, you will need to add CSS styles as well.

$(document).ready(function() {

    $('.row', '.container').slick({
        verticalScrolling: true,
        vertical: true,
        slidesToShow: 1,
        slidesToScroll: 1,
    });
});
* {
    padding: 0;
    margin: 0;
}

html {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

*,
*:before,
*:after {
    -webkit-box-sizing: inherit;
    -moz-box-sizing: inherit;
    box-sizing: inherit;
}

button:focus {
    outline: none !important;
}

button {
    display: inline-block;
    padding: 0;
    margin: 0;
    line-height: 1;
    text-align: center;
    border: none;
    background: none;
    cursor: pointer;
}

img {
    max-width: 100%;
}



.container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.row {
    position: relative;
    overflow: hidden;
}

.container .item {
    float: left;
    text-align: center;
}

.row .item img {
    display: block;
    margin: 0 auto;
}

.slick-no-slide .slick-track {
    width: 100% !important;
    text-align: center;
    transform: inherit !important;
}

.slick-no-slide .slick-slide {
    float: none;
    display: inline-block;
}

.slick-list {
    position: relative;
    overflow: hidden;
}

.slick-dots {
    text-align: center;
}

.slick-dots li {
    display: inline-block;
}

.slick-dots li button {
    width: 10px;
    height: 10px;
    margin: 0 5px;
    font-size: 0;
    background-color: grey;
    border-radius: 50%;
    border: none;
}

.slick-dots .slick-active button {
    background-color: black;
}

.slick-prev {
    right: 10px;
    /* Add custom image URL for the previous button here */
}

.slick-next {
    left: 10px;
    /* Add custom image URL for the next button here */
}

.slick-arrow {
    position: absolute;
    top: 48%;
    z-index: 1;
    width: 15px;
    height: 30px;
    font-size: 0;
    background-size: 100% 100%;
}

I removed div.items since it didn't have any styling and was not covering div.item. The parent should be div.slick because that's where you are applying the styles in JavaScript. Please replace the placeholder URLs in .slick-next and .slick-prev with images of your choice for the buttons.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What could be causing the error message "userID is not defined" to appear?

Can someone assist me with this script issue? I keep receiving the error message "userID is not defined." I'm attempting to bulk modify licenses following a tutorial on https://www.youtube.com/watch?v=e4KTAytOeyA function updateLicenses() { var u ...

The ng-click function is not functioning as intended

As I work on developing a single-page web application with a focus on the AngularJS framework, I've run into an issue while utilizing the ng-click directive. It seems that upon clicking, the directive isn't functioning as expected. The associate ...

How about this: "Using jQuery, we detached the element with the class 'myClass', then cloned it. But wait, where did my nested table go?"

I'm facing an issue where I have a div containing a table that I want to reuse for multiple entries in a JSON database. <div class="myButton"> <table> <tr id="currentVersion"> ...

Retrieving data from an array using an AJAX request function

I've been attempting to utilize an AJAX call to update a series of image elements on a webpage. The array containing the elements to update is populated with URLs fetched from a PHP page via AJAX. The issue I'm encountering with the code provide ...

Tips for increasing efficiency in Javascript development by leveraging the power of the computer to automate tasks and minimize manual work

When working with JavaScript, what techniques can be used to develop and test efficiently and accurately while focusing on algorithms rather than mechanics? Are there any useful tools that can be utilized in batch or command line mode (outside of an integr ...

Transform unidentified individuals into authenticated users using Firebase Authentication for Google

Currently, I am integrating Firebase Auth with VueJS and facing the challenge of converting an anonymous authentication user to a registered user using Google. I have implemented the following code snippet from a reference: fromAnonymousToGoogle: funct ...

Tips for indicating request parameters in Drive.Comments.list

I have successfully retrieved the default 20 comments using the code below by specifying a single fileId parameter. However, I am interested in pulling back one hundred comments or paginating to the next set of 20 out of curiosity. In my getComments funct ...

Is there a way to successfully integrate a JavaScript file that has been downloaded from `npm` or `yarn` into a web client or

Currently, I am following a guide titled "Headless Drupal with React" on Medium. The tutorial itself does not address my specific questions. In the tutorial, it demonstrates importing React and ReactDOM directly from CDN in the .html file. My query revolv ...

Submitting modal form information using AJAX to PHP

As a novice in the realm of web programming, I find myself seeking some guidance to untangle a riddle. Regrettably, my grasp of the basics still leaves much to be desired. Within my main page, view.adminsettings.php, I've designated a Navigation DIV ...

How to use jQuery to extract a particular text from an anchor tag

If I want to choose a specific anchor text and make changes to it, I can do so by targeting anchors with a certain href attribute. For example, on a page with multiple unordered lists, each containing different links: <ul> <li><a href="v ...

Utilizing Vue.js components and properties to invoke a function

Trying to create a shopping cart button that keeps track of how many times it's clicked, but encountering an issue where the function called by the button doesn't receive the correct parameter. I attempted using {{id}} and :onClick="addThisToCar ...

Transitioning with an ellipsis

Currently, I am working on a project where I am trying to utilize the CSS property text-overflow: ellipsis to achieve a specific animation. However, despite applying this property along with white-space: nowrap and overflow: hidden to .card-dish__info, I a ...

utilize console.log within the <ErrorMessage> element

Typically, this is the way the <ErrorMessage> tag from Formik is utilized: <ErrorMessage name="email" render={(msg) => ( <Text style={styles.errorText}> ...

Tips for testing a service in Angular using unit testing techniques

Within my service, I have a function that looks like this: exportPayGapDetails(filterObject: PayGapDetailFilter): void { const url = `${this.payGapDetailExportUrls[filterObject.type]}`; this.http .post<PollInitResponse>( `/adpi/rest/v2/s ...

What is the best method to retrieve JSON data from a Rest API?

In my JavaScript code, I am creating an object: var t = null; $.getJSON('http://localhost:53227/Home/GetData', function (data) { alert(data); t = data; }); alert(t); After ...

Implementing automatic dark mode activation during nighttime with jQuery or JavaScript

I'm looking to implement an automatic dark mode feature on my website that switches on at night and off during the day or morning. Currently, my website has a dark mode toggle code that allows users to switch between dark and light modes using local ...

Can someone provide guidance on iterating through a nested array in d3 and appending child elements accordingly?

Looking at my JSON data, here is an example of what it contains. var data = [ { animal: 'dog', names: [ 'mark', 'cooper', 'pooch' ] }, { animal: 'cat', names: [ 'mary', 'kitty' ] ]; ...

The ul class is not aligned with the website logo

My navigation menu items are not appearing inline with the logo on my website. I suspect it might be due to the size of the logo. I've attempted to adjust the width property of the #logo element, but it doesn't seem to be working... Here is a vi ...

Ensure that the responsive SVG image remains centered even when resizing

I have been attempting to center crop the responsive SVG image while resizing. Even though I used preserveAspectRatio="xMidYMax slice", the image width does not stay consistent with my screen size. body{ margin:0;padding:0; } .wrapper { position: re ...

How to position two divs next to each other using CSS with just one adjustment

Is it possible to position two divs side by side, with one of them moving continuously up and down while containing an image? I attempted the following code: <div> <div style="margin:30px;width:100px;height:250px;position:relative;float:left; ...