Why is the Slick Slider displaying previous and next buttons instead of icons?

I'm currently working on creating a slider using the slick slider. Everything seems to be functioning properly, but instead of displaying arrows on the sides, it's showing Previous and Next buttons stacked vertically on the left side. It appears that the CSS is not loading correctly, even though I've included the slick slider CSS library. I've searched online for solutions to similar issues, but nothing has worked in my specific case. Any assistance would be greatly appreciated!

Below is the code snippet:

$(document).ready(function(){
  $('.box').slick({
    dots: false,
    infinite: false,
    slidesToShow: 4,
    slidesToScroll: 4,
    responsive: [
      {
        breakpoint: 1024,
        settings: {
          slidesToShow: 3,
          slidesToScroll: 3,
          infinite: true,
          dots: false
        }
      },
      {
        breakpoint: 600,
        settings: {
          slidesToShow: 2,
          slidesToScroll: 2
        }
      },
      {
        breakpoint: 480,
        settings: {
          slidesToShow: 1,
          slidesToScroll: 1
        }
      }
      // You can unslick at a given breakpoint now by adding:
      // settings: "unslick"
      // instead of a settings object
    ]
  });
});
.main-container {
  padding: 50px;
}

.box {
  display: grid;
  grid-gap: 20px;
  grid-template-columns: repeat(6, minmax(100px, 1fr));
  height: 220px;
}

// Other CSS styles...

Head section includes jQuery CDN and Slick Slider library links.

Body section contains the HTML structure for the slider implementation.

Answer №1

myscript.js

// custom box slider script
$("#box-prev").click(function () {
  $(".box").slick("slickPrev");
});

$("#box-next").click(function () {
  $(".box").slick("slickNext");
});

$(".box").slick({
   dots: false,
        infinite: false,
        slidesToShow: 4,
        slidesToScroll: 4,
        arrows: false,
});

Include your own style for the box arrow and add custom CSS rules.

style.css

.box-arrow {
  position: absolute;
  transform: translate(-50%, -50%);
  left: 50%;
  top: 50%;
  width: 112%;
  max-width: 480px;

  &.transparency-arrow {
    max-width: 100%;
  }

  i {
    color: var(--black-tertiary);
    font-size: 32px;

    &:hover {
      color: var(--black-primary);
    }
  }

  p {
    cursor: pointer;
  }
}

HTML Snippet

<!-- Box Slider Section -->
        <div class="position-relative">
    <div class="box">

          <!-- Video Container Widget -->
          <div class="vid-container bd-10-ut">
            <div class="vid-thumbail">
              <video width="100%">
                <source
                  src="https://player.vimeo.com/external/433944538.sd.mp4?s=01521568a0488626d73b34243e27f74a789ea20b&profile_id=164&oauth2_token_id=57447761">
              </video>
            </div>
           
          </div>

          // Repeat this video container code block as needed

          <div class="box-arrow d-flex justify-content-between gap-3 align-items-center">
            <p class="mb-0 page-btn" id="box-prev">
              <i class="fa-solid fa-chevron-left "></i>
            </p>
            <p class="mb-0 page-btn" id="box-next">
              <i class="fa-solid fa-chevron-right"></i>
            </p>
          </div>

    </div>
    </div>

Answer №2

I finally cracked the code to the issue at hand. It turns out, I had overlooked adding the slick slider theme.css file which caused the display of buttons instead of arrows. Simply include the theme.css file and you'll see that everything works like a charm!

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick-theme.css" integrity="sha512-6lLUdeQ5uheMFbWm3CP271l14RsX1xtx+J5x2yeIDkkiBpeVTNhTqijME7GgRKKi6hCqovwCoBTlRBEC20M8Mg==" crossorigin="anonymous" referrerpolicy="no-referrer" />

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

The conditional CSS appears to be malfunctioning

Hi, I am attempting to use conditional CSS in my stylesheet to set a different width for IE6. I have tried the following code but it is not working: div.box { width: 400px; [if IE 6] width: 600px; padding: 0 100px; } How can I su ...

Applying Regular Expressions in Java to "convert" a CSS style into an HTML tag style

In my Java code, I have a String variable that contains HTML code like this: <span style="text-decoration: underline;">test</span> My goal is to convert it to look like this: <u>test</u> If the HTML code is like this: <span ...

Parsing HTML to access inner content

Currently, I have integrated an onClick event to an anchor tag. When the user interacts with it, my objective is to retrieve the inner HTML without relying on the id attribute. Below is the code snippet that illustrates my approach. Any assistance in acc ...

"Resetting count feature in AngularJS: A step-by-step guide

I have a list consisting of four items, each with its own counter. Whenever we click on an item, the count increases. I am looking to reset the counter value back to zero for all items except the one that was clicked. You can view the demonstration here. ...

Implementing a div element within an autosuggest feature

i am currently integrating the bsn autosuggest into my project could someone please guide me on how to insert a div in the result so that it appears like this <div style="left: 347px; top: 1024px; width: 400px;" class="autosuggest" id="as_testinput_x ...

The transition kicks in as soon as the page finishes loading

I am attempting to incorporate transitions on divs when the page loads, but I am encountering difficulties getting it to work. template <header> <transition name="slideLeft"> <div v-show="loaded" class="contents content-left"&g ...

Retrieve the string saved in a ViewBag when the ajax call is successful

I am new to ASP.NET MVC and have been struggling to find a solution to this problem. Despite searching on various platforms, including Stack Overflow, I have not been able to resolve it. Here are some links to solutions that did not work for me: Possible ...

How to stop Bootstrap collapsible items from "shifting"

I recently integrated a Bootstrap collapse plugin to manage my list of common inquiries: https://jsfiddle.net/2d8ytuq0/ <ul class="faq__questions"> <li> <a href="#" data-toggle="collapse" data-target="#faq__question_1">..</a> ...

Does a specific HTML element exist that is unable to have JavaScript within its content?

Let me pose a question, and while the answer may be "no", it never hurts to inquire... I am in need of taking in formatted text as HTML markup and later displaying the HTML to showcase the formatted text. This is an extremely common situation. Even popula ...

In jQuery, a function that includes an ajax() function will not directly return the response from the ajax() call

Attempting to enhance the modularity of my jQuery code, I have encapsulated an ajax() function within another function called fetch_ajax(). The goal is for fetch_ajax() to be able to accept parameters from different locations and execute the contained ajax ...

It never fails to function automatically, no matter which script is being executed

By default, the script will always be executed regardless of its environment. Check out my code snippet: import { Pool } from 'pg'; import config from './../config'; const connectionString = () => { switch (process.env.NODE_EN ...

In JavaScript, there is a missing piece of logic when iterating through an array to find

I am working on a solution to populate empty values when data is not available for specific months. You can view my progress on Plunker here: http://plnkr.co/edit/f0IklkUfX8tkRZrn2enx?p=preview $scope.year = [ {"month":"mar", "val":"23"}, {"month":"feb", ...

How can you create a basic slideshow without relying on jQuery to cycle through images?

Imagine you have a div containing 3 images. Is there a way to build a basic slideshow that smoothly transitions between the images, showing each one for 5 seconds before moving on to the next one and eventually looping back to the first image without rely ...

Restrict the size of the numerical input in AngularJS

<input class="span10" type="number" max="99999" ng-maxLength="5" placeholder="Enter Points" ng-change="myFunc($index)" ng-model="myVar"> This code snippet adjusts the value of form.input.$valid to false if the number entered exceeds 99999 or is long ...

Nuxt.js transition issue: How to fix transitions not working

LOGIC: The pages/account.vue file consists of two child components, components/beforeLogin and components/afterLogin. The inclusion of child components is based on a conditional check within pages/account.vue using a string result ('x') stored in ...

Adjust the color of both the image and text when hovering over either one

I need help creating a hover effect for an image and text pair. My goal is to have the image change when hovered over, along with changing the color of the text next to it. Below is the code I am currently working with: <ul id="recherche"> < ...

ClickAwayListener is preventing the onClick event from being fired within a component that is nested

I am encountering an issue with the clickAwayListener feature of material-ui. It seems to be disabling the onClick event in one of the buttons on a nested component. Upon removing the ClickAwayListener, everything functions as expected. However, with it e ...

What sets apart using 'self.fn.apply(self, message)' from 'self.fn(message)', and what are the advantages of using the former method?

Whenever I come across code that looks like thisnewPromise.promiseDispatch.apply(newPromise, message), I can't help but wonder why they didn't simply use newPromise.promiseDispathch(message) ...

Techniques for transferring checkbox values to a JavaScript function

Here is the code snippet I am working with: <input type="checkbox" name="area" id="area" value="0">Some Text1</input> <input type="checkbox" name="area" id="area" value="80">Some Text2</input> Additionally, here is the JavaScript ...

Dealing with dynamic CORS settings in Apache and PHP

Dealing with CORS has been quite a challenge for me. My javascript is sending AJAX Put/Fetch requests to an Apache/PHP script. In this particular scenario, the javascript is being executed on CodePen while the Apache/PHP script is hosted on a local serve ...