0

Instead of text or images, I would like to use font-awesome for the previous & next button on the Tiny Slider plugin.

I tried the following which didn't work:

<div id="controls">
  <!--<button class="previous">Prev</button>-->
  <i class="fas fa-chevron-left previous"></i>
</div>

<div class="slider">
  <article>
    <img src="1.jpg" />
  </article>
  <article>
    <img src="2.jpg" />
  </article>  
</div>

<script type="module">
  var slider = tns({
    container: '.slider',
      controlsContainer: '#controls',
      prevButton: '.previous',
  });
</script>

How can I get this working using font-awesome instead of text or images?

migu
  • 4,236
  • 5
  • 39
  • 60

2 Answers2

1

Did you simply tried like that:

<div id="controls">
  <button class="previous"><i class="fas fa-chevron-left"></i></button>
</div>
Caner
  • 92
  • 3
0

I'm guessing you'd still need to have an actual button for the controls to work. Instead of removing the entire button, just replace the text "Prev" with your icon html. And then format the resultant button with css as per your needs.

Siddharth Bhansali
  • 2,017
  • 2
  • 10
  • 19