Jump to content

yugiorima123

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by yugiorima123

  1. 3 minutes ago, dsonesuk said:

    vLeftButton, IconL, leftAction(), hmmm wonder why it does not work for right? A real puzzler this one.

    <script >
      var vLeftButton = document.getElementById("iconL");
      //var t = setInterval(leftAction,1000);
      function leftAction(){
      var myImgs = document.getElementById("divImg");
      var child = myImgs.children[0];
      //alert(child.src);
      myImgs.removeChild(child);
      myImgs.appendChild(child);
      }
       
      var vRightButton = document.getElementById("iconR");
      function rightAction(){
      var myImgs = document.getElementById("divImg");
      var child = myImgs.children[0];
      //alert(child.src);
      myImgs.removeChild(child);
      myImgs.appendChild(child);
      }
     

    </script>

    mean:

    but right button don't move to right

    I'm amateur😢

  2. How can we create carousel image slider using Javascript ?

     carousel-acf-slider.pngi

    Im used 

    <script >
      var vLeftButton = document.getElementById("iconL");
      //var t = setInterval(leftAction,1000);
      function leftAction(){
      var myImgs = document.getElementById("divImg");
      var child = myImgs.children[0];
      //alert(child.src);
      myImgs.removeChild(child);
      myImgs.appendChild(child);
      }
       
      var vRightButton = document.getElementById("iconR");
      function rightAction(){
      var myImgs = document.getElementById("divImg");
      var child = myImgs.children[0];
      //alert(child.src);
      myImgs.removeChild(child);
      myImgs.appendChild(child);
      }
     

    </script>

    I mean:

    leftbutton move to left

    but right button don't move to right

    I'm amateur😢

×
×
  • Create New...