Issue with Slick Slider: Next Arrow not visible

I'm attempting to display the next and previous arrows alongside the product slider, similar to the Slick Slider example. However, I'm facing an issue where the expected fonts are not loading properly.

Below is my code:

HTML

  <div class="slider">
      <div>
        <img src="http://www.onguardapparel.com/images/products/thumb/8013LN_Cat.jpg" height="100" width="100">
      </div>
      <div>
        <img src="http://www.onguardapparel.com/images/products/thumb/HiddenTailor.9074B.jpg" height="100" width="100">
      </div>
      <div>
        <img src="http://www.onguardapparel.com/images/products/thumb/1600ETY.JPG" height="100" width="100">
      </div>
      <div>
        <img src="http://www.onguardapparel.com/images/products/thumb/VIPERPRO81.jpg" height="100" width="100">
      </div>
      <div>
        <img src="http://www.onguardapparel.com/images/products/thumb/garment_bag.jpg" height="100" width="100">
      </div>
      <div>
        <img src="http://www.onguardapparel.com/images/products/thumb/1077.jpg" height="100" width="100">
      </div>
    </div>

CSS

  body{
    background-color: #fff;
  }
  .slider{
    margin: 60px auto;
    width: 500px;
  }
  div{
    height: 100%;
  }
  p{
    text-align: center;
    font-size: 12px;
    color: white;
  }

JavaScript

$(document).ready(function(){
        $('.slider').slick({
            centerMode: true,
            centerPadding: '60px',
            dots: false,
            infinite: true,
            speed: 300,
            slidesToShow: 4,
            slidesToScroll: 1,
            arrows: true
        });
      });

DEMO: http://jsfiddle.net/schwany23/j39j568c/

Answer №1

Don't forget to include the slick-theme.css file as an external resource in your fiddle for default styling by the author or create your own CSS file for custom styling.

<link rel="stylesheet" type="text/css" href="http://kenwheeler.github.io/slick/slick/slick-theme.css"/>

Also, add this CSS for visibility:

.slick-prev:before, .slick-next:before{
    color:red;
}

View the updated jsFiddle here.

Check out the code snippet below...

$(document).ready(function() {
  $('.slider').slick({
    centerMode: true,
    centerPadding: '60px',
    dots: true,
    /* Just changed this to get the bottom dots navigation */
    infinite: true,
    speed: 300,
    slidesToShow: 4,
    slidesToScroll: 1,
    arrows: true
  });
});
body {
        background-color: #fff;
      }
      .slider {
        margin: 60px auto;
        width: 500px;
      }
      div {
        height: 100%;
      }
      p {
        text-align: center;
        font-size: 12px;
        color: white;
      }
      /* added the following to give the background color of the arrows as red for visibility, the default which can be found in the slick-theme.css was white */
      .slick-prev:before,
      .slick-next:before {
        color: red;
      }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script><script src="http://kenwheeler.github.io/slick/slick/slick.js"></script>
<link href="http://kenwheeler.github.io/slick/slick/slick.css" rel="stylesheet"/>
<link href="http://kenwheeler.github.io/slick/slick/slick-theme.css" rel="stylesheet"/>

<div class="slider">
  <div>
    <img src="http://www.onguardapparel.com/images/products/thumb/8013LN_Cat.jpg" height="100" width="100" />
  </div>
  <div>
    <img src="http://www.onguardapparel.com/images/products/thumb/HiddenTailor.9074B.jpg" height="100" width="100" />
  </div>
  <div>
    <img src="http://www.onguardapparel.com/images/products/thumb/1600ETY.JPG" height="100" width="100" />
  </div>
  <div>
    <img src="http://www.onguardapparel.com/images/products/thumb/VIPERPRO81.jpg" height="100" width="100" />
  </div>
  <div>
    <img src="http://www.onguardapparel.com/images/products/thumb/garment_bag.jpg" height="100" width="100" />
  </div>
  <div>
    <img src="http://www.onguardapparel.com/images/products/thumb/1077.jpg" height="100" width="100" />
  </div>
</div>

Hope this information is helpful!

Answer №2

To style the arrows on a white background, simply include a color attribute in your CSS code:

.slick-prev:before, .slick-next:before {
  color: #09529b !important;
}

Answer №3

If you have imported slick-theme.css and are still experiencing issues, it may be due to the theme expecting to be located in a subfolder (e.g. /theme/slick-theme.css). However, the default download places slick-theme.css in the same folder as ajax-loader.gif and the fonts folder, both of which are referenced from the theme.

Resolution: Move the slick-theme.css file to a subfolder or modify the CSS so that it does not attempt to access a parent folder. It may also be necessary to adjust the color of the arrows as recommended by Sai

Answer №4

Sometimes, you may encounter a situation where your logic falls short due to not having enough slides.

For instance: when you have only 4 slides and set Infinite to true with slidesToShow: 4, the navigation arrows will never show up.

To remedy this, simply add one more slide to reveal the navigation buttons.

Answer №5

Don't forget to adjust the arrows in slick-theme.css as they are currently set at -25px. This is important because you have specified margin=0px for the entire page.

Answer №6

To make the text appear on hover, simply adjust the font size from 0 to 13px.

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

Properly formatting HTML tags fetched from jsondata using jQuery and PHP

Seeking guidance here, as I am fairly new to utilizing jquery/json. Although I have successfully retrieved data from my database in json format, I am facing issues with displaying it correctly on the webpage. I have two main questions: Is my data storag ...

Display icons within each table cell row

Objective: I want to implement a feature where icons appear when the cursor is inside a td row, allowing users to click on them. These icons will contain links. When the cursor moves to a new td row, the previous row should return to its default state a ...

What methods are available in JavaScript for determining the width of a section and implementing proper spacing for a menu?

Is it possible to use Javascript to dynamically adjust the size of each <li> element within the menuArea so that they fill the entire space correctly? // Could we achieve this with the following code... var menuSpace = Math.floor((menuAreaWidth ...

Triggering Various Button Click Actions with Jquery Event Handlers

Is it possible to attach several Button Click events to the same function like the example below? $(document).on("click", "#btn1 #btn2 #btn3", callbackFunction); ...

Retrieve the XML document and substitute any occurrences of ampersands "&" with the word "and" within it

The XML file is not being read by the browser due to the presence of ampersands represented as "&". To resolve this, I am looking to retrieve the XML file and replace all instances of "&" with "and". Is this achievable? Despite attempting to use t ...

Utilize Jquery to transmit a list

Here is some code I am working with: $("#allphotos").click(function () { $("<div></div>") .addClass("dialog") .appendTo("body") .dialog({ clos ...

How can I adjust the position of a circular progress bar using media queries?

My code involves creating a circular progress bar. However, I am facing an issue where the circles stack on top of each other when I resize the window, as shown in the output screenshot. I want to ensure that the position of the 3 circles remains fixed whe ...

What is the alternative method for submitting a value in a <select><option> without using a submit button?

Below is the code snippet I am working with: <form action="?sort=SELECTEDVALUEHERE" method="GET> <select> <option value="1">Option 1 </option> <option value="2">Option 2 </option> <option value="3">Option 3 < ...

Increment and Decrement Values with JQuery

I am looking to implement a client-side Plus/Minus system where users can click on the plus sign to increase a value by 1 and minus sign to decrease the value by 1. The value should not go below zero and it should initially start at 0. Is there a simple wa ...

Transmit information from a Chrome extension to a Node.js server

Recently, I developed a basic Chrome extension that captures a few clicks on a specific webpage and stores the data in my content_script. Now, I am looking for ways to transmit this data (in JSON format) to my node.js file located at /start. I am seeking ...

Ajax seems to be operating efficiently initially, but experiences hiccups upon

This is what's happening: In my CodeIgniter application, which is a demo social network, I am working on implementing the LIKE button feature. As I loop through the posts using a foreach loop, a like button is displayed after each post. Initially, i ...

Dealing with the information received from a PHP response during an AJAX request using JavaScript

Here is my PHP script <?php //establishing connection to the server //selecting the database $temporaryArray = array(); $counter = 0; $result = mysql_query("some query"); while($row = mysql_fetch_assoc($result)) { $temporaryArray["$counter"]= $row[" ...

Google Maps in Angular is not showing up

My Angular Google Maps implementation seems to be working, but unfortunately, the map is not showing on my website. I have confirmed that my JS is loading the maps and I can retrieve the map properties. Interestingly, when I check the Chrome AngularJS Debu ...

Assign the value to the index of the dropdown list

Recently, I encountered a dilemma with my dropdown list. <label for="staffType">Staff Type<br /></label> <select id="myList" name="staffType" onchange="show()"> <option>Care Staff</option> <o ...

Above the search box in jQuery Datatable's search box, there is search text displayed

My datatable looks like this: var exTable1 = $("#exTable").DataTable({ "language": { "search": "Filter", "searchPlaceholder": "search", "loadingRecords": "", }, data: datasrc "dom": '<"top"lf>rt<"botto ...

Animating the translation of a rectangle using the RequestAnimationFrame method

First of all, I have developed Live Code QUERY: How can I create an animation where a rectangle continuously moves across the X-axis? Issue: Currently, my animation only plays once and then disappears offscreen. Even though the position x is reset to z ...

Using jQuery ajaxPrefilter with Expression Engine

I'm struggling to implement a jQuery ajaxPrefilter with the following JavaScript code. This is how I am currently calling the ajax function. var $setallow = $(".show"); $setallow.click(function() { var $allow = $(this).closest("form"); var fo ...

Applying hover effect to material-ui IconButton component

As stated in the React Material-UI documentation, I have access to a prop called hoveredStyle: http://www.material-ui.com/#/components/icon-button I intend to utilize the IconButton for two specific purposes: Make use of its tooltip prop for improved ac ...

The CSS transition fails to function correctly when rendering a React element within an array

When rendering a React component within an array using CSS transitions, I noticed that the elements in the array re-order and change style. Surprisingly, only the elements moving up have transitions applied, while the ones moving down do not. I expect all ...

How can I incorporate Bootstrap multi-select into the jQuery DataTables DOM?

Having trouble implementing a bootstrap multi-select inside a jQuery datatable DOM. I followed this example to add a custom element within the jQuery datatable container. It works fine for normal bootstrap select, but when trying to add a bootstrap multi-s ...