How to add left and right arrows to scroll slider without jQuery and bootstrap?












0















how to add right and left arrows for scroller without jQuery or bootstrap ?



how to i add right and left arrows for below horizontal scroller. Without jQuery or bootstrap. Thank you.



The scroll bar now is mobile friendly and scrolling with finger



Has any idea how to take it



Like:- < >



Demo image:- https://ibb.co/mmPWLL






#card_slider {
clear: both;
overflow-y: hidden;
overflow-x: scroll;
height: 235px;
margin-top: 20px;
position: relative;
padding-left: 5px;
padding-top: 0px;
}

#card_slider::-webkit-scrollbar {
height: 5px;
}

#card_slider::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.3);
border-radius: 0px;
}

#card_slider::-webkit-scrollbar-thumb {
background-color: #5d646c;
border-radius: 0px;
}

#card_track {
position: absolute;
width: 2000px;
}

.subject_card {
border-radius: 8px;
height: 215px;
width: 178px;
background-color: #fff;
color: #5d646c;
float: left;
margin-right: 20px;
display: inline;
box-shadow: 0px 2px 4px 0px rgb(82, 82, 88);
}

.subject_card > img {
border-top-left-radius: 8px;
border-top-right-radius: 8px;
width: 178px;
height: 135px;
display: block;
}

.subject_card > p {
padding-left: 5px;
padding-right: 5px;
margin-top: 5px;
overflow: hidden;
max-height: 60px;
}

<div id="card_slider">
<div id="card_track">
<a href=" ">
<div class="subject_card">
<img src=" " />
<p>Title #1</p>
</div>
</a>
<a href=" ">
<div class="subject_card">
<img src=" " />
<p>Title #2</p>
</div>
</a>
<a href=" ">
<div class="subject_card">
<img src=" " />
<p>Title #2</p>
</div>
</a>
<a href=" ">
<div class="subject_card">
<img src=" " />
<p>Title #2</p>
</div>
</a>
<a href=" ">
<div class="subject_card">
<img src=" " />
<p>Title #2</p>
</div>
</a>
<a href=" ">
<div class="subject_card">
<img src=" " />
<p>Title #2</p>
</div>
</a>
<a href=" ">
<div class="subject_card">
<img src=" " />
<p>Title #2</p>
</div>
</a>
<a href=" ">
<div class="subject_card">
<img src=" " />
<p>Title #2</p>
</div>
</a>

<a href=" ">
<div class="subject_card">
<img src=" " />
<p>Title #3</p>
</div>
</a>
<a href=" ">
<div class="subject_card">
<img src=" " />
<p>Title #4</p>
</div>
</a>
</div>
</div>





Thank You!










share|improve this question



























    0















    how to add right and left arrows for scroller without jQuery or bootstrap ?



    how to i add right and left arrows for below horizontal scroller. Without jQuery or bootstrap. Thank you.



    The scroll bar now is mobile friendly and scrolling with finger



    Has any idea how to take it



    Like:- < >



    Demo image:- https://ibb.co/mmPWLL






    #card_slider {
    clear: both;
    overflow-y: hidden;
    overflow-x: scroll;
    height: 235px;
    margin-top: 20px;
    position: relative;
    padding-left: 5px;
    padding-top: 0px;
    }

    #card_slider::-webkit-scrollbar {
    height: 5px;
    }

    #card_slider::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.3);
    border-radius: 0px;
    }

    #card_slider::-webkit-scrollbar-thumb {
    background-color: #5d646c;
    border-radius: 0px;
    }

    #card_track {
    position: absolute;
    width: 2000px;
    }

    .subject_card {
    border-radius: 8px;
    height: 215px;
    width: 178px;
    background-color: #fff;
    color: #5d646c;
    float: left;
    margin-right: 20px;
    display: inline;
    box-shadow: 0px 2px 4px 0px rgb(82, 82, 88);
    }

    .subject_card > img {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    width: 178px;
    height: 135px;
    display: block;
    }

    .subject_card > p {
    padding-left: 5px;
    padding-right: 5px;
    margin-top: 5px;
    overflow: hidden;
    max-height: 60px;
    }

    <div id="card_slider">
    <div id="card_track">
    <a href=" ">
    <div class="subject_card">
    <img src=" " />
    <p>Title #1</p>
    </div>
    </a>
    <a href=" ">
    <div class="subject_card">
    <img src=" " />
    <p>Title #2</p>
    </div>
    </a>
    <a href=" ">
    <div class="subject_card">
    <img src=" " />
    <p>Title #2</p>
    </div>
    </a>
    <a href=" ">
    <div class="subject_card">
    <img src=" " />
    <p>Title #2</p>
    </div>
    </a>
    <a href=" ">
    <div class="subject_card">
    <img src=" " />
    <p>Title #2</p>
    </div>
    </a>
    <a href=" ">
    <div class="subject_card">
    <img src=" " />
    <p>Title #2</p>
    </div>
    </a>
    <a href=" ">
    <div class="subject_card">
    <img src=" " />
    <p>Title #2</p>
    </div>
    </a>
    <a href=" ">
    <div class="subject_card">
    <img src=" " />
    <p>Title #2</p>
    </div>
    </a>

    <a href=" ">
    <div class="subject_card">
    <img src=" " />
    <p>Title #3</p>
    </div>
    </a>
    <a href=" ">
    <div class="subject_card">
    <img src=" " />
    <p>Title #4</p>
    </div>
    </a>
    </div>
    </div>





    Thank You!










    share|improve this question

























      0












      0








      0


      0






      how to add right and left arrows for scroller without jQuery or bootstrap ?



      how to i add right and left arrows for below horizontal scroller. Without jQuery or bootstrap. Thank you.



      The scroll bar now is mobile friendly and scrolling with finger



      Has any idea how to take it



      Like:- < >



      Demo image:- https://ibb.co/mmPWLL






      #card_slider {
      clear: both;
      overflow-y: hidden;
      overflow-x: scroll;
      height: 235px;
      margin-top: 20px;
      position: relative;
      padding-left: 5px;
      padding-top: 0px;
      }

      #card_slider::-webkit-scrollbar {
      height: 5px;
      }

      #card_slider::-webkit-scrollbar-track {
      -webkit-box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.3);
      border-radius: 0px;
      }

      #card_slider::-webkit-scrollbar-thumb {
      background-color: #5d646c;
      border-radius: 0px;
      }

      #card_track {
      position: absolute;
      width: 2000px;
      }

      .subject_card {
      border-radius: 8px;
      height: 215px;
      width: 178px;
      background-color: #fff;
      color: #5d646c;
      float: left;
      margin-right: 20px;
      display: inline;
      box-shadow: 0px 2px 4px 0px rgb(82, 82, 88);
      }

      .subject_card > img {
      border-top-left-radius: 8px;
      border-top-right-radius: 8px;
      width: 178px;
      height: 135px;
      display: block;
      }

      .subject_card > p {
      padding-left: 5px;
      padding-right: 5px;
      margin-top: 5px;
      overflow: hidden;
      max-height: 60px;
      }

      <div id="card_slider">
      <div id="card_track">
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #1</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>

      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #3</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #4</p>
      </div>
      </a>
      </div>
      </div>





      Thank You!










      share|improve this question














      how to add right and left arrows for scroller without jQuery or bootstrap ?



      how to i add right and left arrows for below horizontal scroller. Without jQuery or bootstrap. Thank you.



      The scroll bar now is mobile friendly and scrolling with finger



      Has any idea how to take it



      Like:- < >



      Demo image:- https://ibb.co/mmPWLL






      #card_slider {
      clear: both;
      overflow-y: hidden;
      overflow-x: scroll;
      height: 235px;
      margin-top: 20px;
      position: relative;
      padding-left: 5px;
      padding-top: 0px;
      }

      #card_slider::-webkit-scrollbar {
      height: 5px;
      }

      #card_slider::-webkit-scrollbar-track {
      -webkit-box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.3);
      border-radius: 0px;
      }

      #card_slider::-webkit-scrollbar-thumb {
      background-color: #5d646c;
      border-radius: 0px;
      }

      #card_track {
      position: absolute;
      width: 2000px;
      }

      .subject_card {
      border-radius: 8px;
      height: 215px;
      width: 178px;
      background-color: #fff;
      color: #5d646c;
      float: left;
      margin-right: 20px;
      display: inline;
      box-shadow: 0px 2px 4px 0px rgb(82, 82, 88);
      }

      .subject_card > img {
      border-top-left-radius: 8px;
      border-top-right-radius: 8px;
      width: 178px;
      height: 135px;
      display: block;
      }

      .subject_card > p {
      padding-left: 5px;
      padding-right: 5px;
      margin-top: 5px;
      overflow: hidden;
      max-height: 60px;
      }

      <div id="card_slider">
      <div id="card_track">
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #1</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>

      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #3</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #4</p>
      </div>
      </a>
      </div>
      </div>





      Thank You!






      #card_slider {
      clear: both;
      overflow-y: hidden;
      overflow-x: scroll;
      height: 235px;
      margin-top: 20px;
      position: relative;
      padding-left: 5px;
      padding-top: 0px;
      }

      #card_slider::-webkit-scrollbar {
      height: 5px;
      }

      #card_slider::-webkit-scrollbar-track {
      -webkit-box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.3);
      border-radius: 0px;
      }

      #card_slider::-webkit-scrollbar-thumb {
      background-color: #5d646c;
      border-radius: 0px;
      }

      #card_track {
      position: absolute;
      width: 2000px;
      }

      .subject_card {
      border-radius: 8px;
      height: 215px;
      width: 178px;
      background-color: #fff;
      color: #5d646c;
      float: left;
      margin-right: 20px;
      display: inline;
      box-shadow: 0px 2px 4px 0px rgb(82, 82, 88);
      }

      .subject_card > img {
      border-top-left-radius: 8px;
      border-top-right-radius: 8px;
      width: 178px;
      height: 135px;
      display: block;
      }

      .subject_card > p {
      padding-left: 5px;
      padding-right: 5px;
      margin-top: 5px;
      overflow: hidden;
      max-height: 60px;
      }

      <div id="card_slider">
      <div id="card_track">
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #1</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>

      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #3</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #4</p>
      </div>
      </a>
      </div>
      </div>





      #card_slider {
      clear: both;
      overflow-y: hidden;
      overflow-x: scroll;
      height: 235px;
      margin-top: 20px;
      position: relative;
      padding-left: 5px;
      padding-top: 0px;
      }

      #card_slider::-webkit-scrollbar {
      height: 5px;
      }

      #card_slider::-webkit-scrollbar-track {
      -webkit-box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.3);
      border-radius: 0px;
      }

      #card_slider::-webkit-scrollbar-thumb {
      background-color: #5d646c;
      border-radius: 0px;
      }

      #card_track {
      position: absolute;
      width: 2000px;
      }

      .subject_card {
      border-radius: 8px;
      height: 215px;
      width: 178px;
      background-color: #fff;
      color: #5d646c;
      float: left;
      margin-right: 20px;
      display: inline;
      box-shadow: 0px 2px 4px 0px rgb(82, 82, 88);
      }

      .subject_card > img {
      border-top-left-radius: 8px;
      border-top-right-radius: 8px;
      width: 178px;
      height: 135px;
      display: block;
      }

      .subject_card > p {
      padding-left: 5px;
      padding-right: 5px;
      margin-top: 5px;
      overflow: hidden;
      max-height: 60px;
      }

      <div id="card_slider">
      <div id="card_track">
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #1</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #2</p>
      </div>
      </a>

      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #3</p>
      </div>
      </a>
      <a href=" ">
      <div class="subject_card">
      <img src=" " />
      <p>Title #4</p>
      </div>
      </a>
      </div>
      </div>






      html css slider carousel scroller






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 16 '18 at 5:02









      Saikrishana PatelSaikrishana Patel

      11




      11
























          1 Answer
          1






          active

          oldest

          votes


















          0














          You can create two buttons, Something like this.



            <button  onclick="showImage(-1)">❮</button>
          <button conclick="showImage(+1)">❯</button>


          and write the javascript function something like this to select the images



          function(showImage(n){
          var y;
          var x = document.getElementsByClassName("mySlides");
          if (n > x.length) {slideIndex = 1}
          if (n < 1) {slideIndex = x.length} ;
          for (y= 0; y < x.length; y++) {
          x[y].style.display = "none";
          }
          x[slideIndex-1].style.display = "block";
          }


          Hope it helps






          share|improve this answer
























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53331734%2fhow-to-add-left-and-right-arrows-to-scroll-slider-without-jquery-and-bootstrap%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            You can create two buttons, Something like this.



              <button  onclick="showImage(-1)">❮</button>
            <button conclick="showImage(+1)">❯</button>


            and write the javascript function something like this to select the images



            function(showImage(n){
            var y;
            var x = document.getElementsByClassName("mySlides");
            if (n > x.length) {slideIndex = 1}
            if (n < 1) {slideIndex = x.length} ;
            for (y= 0; y < x.length; y++) {
            x[y].style.display = "none";
            }
            x[slideIndex-1].style.display = "block";
            }


            Hope it helps






            share|improve this answer




























              0














              You can create two buttons, Something like this.



                <button  onclick="showImage(-1)">❮</button>
              <button conclick="showImage(+1)">❯</button>


              and write the javascript function something like this to select the images



              function(showImage(n){
              var y;
              var x = document.getElementsByClassName("mySlides");
              if (n > x.length) {slideIndex = 1}
              if (n < 1) {slideIndex = x.length} ;
              for (y= 0; y < x.length; y++) {
              x[y].style.display = "none";
              }
              x[slideIndex-1].style.display = "block";
              }


              Hope it helps






              share|improve this answer


























                0












                0








                0







                You can create two buttons, Something like this.



                  <button  onclick="showImage(-1)">❮</button>
                <button conclick="showImage(+1)">❯</button>


                and write the javascript function something like this to select the images



                function(showImage(n){
                var y;
                var x = document.getElementsByClassName("mySlides");
                if (n > x.length) {slideIndex = 1}
                if (n < 1) {slideIndex = x.length} ;
                for (y= 0; y < x.length; y++) {
                x[y].style.display = "none";
                }
                x[slideIndex-1].style.display = "block";
                }


                Hope it helps






                share|improve this answer













                You can create two buttons, Something like this.



                  <button  onclick="showImage(-1)">❮</button>
                <button conclick="showImage(+1)">❯</button>


                and write the javascript function something like this to select the images



                function(showImage(n){
                var y;
                var x = document.getElementsByClassName("mySlides");
                if (n > x.length) {slideIndex = 1}
                if (n < 1) {slideIndex = x.length} ;
                for (y= 0; y < x.length; y++) {
                x[y].style.display = "none";
                }
                x[slideIndex-1].style.display = "block";
                }


                Hope it helps







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 16 '18 at 5:32









                Vishal ChauhanVishal Chauhan

                11




                11
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53331734%2fhow-to-add-left-and-right-arrows-to-scroll-slider-without-jquery-and-bootstrap%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Florida Star v. B. J. F.

                    Danny Elfman

                    Lugert, Oklahoma