Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67527

What is the opinion about post slider ( javascript ) [closed]

$
0
0

im Trying to improve my JavaScript skills, but i need some help from people who understand it good. Yesterday i made a simple post slider with JavaScript and i would like to know about quality of the slider. Would be nice to get some advices from developers.

thanks for you time :)

"use strict"

var getElement = document.querySelector(".recipes-columns");
var move = 0;
var cauntCol = getElement.querySelectorAll(".recipe-column").length;
var fullWidth = (cauntCol * 240) - 960;


function goLeft() {

  var getElement = document.querySelector(".recipes-columns");

  if (fullWidth == move - 240 || move == 0) {
    move = 480;
    getElement.setAttribute("style", "transform:translateX(-" + move + "px);");
  } else {
    move = move - 240;
    getElement.setAttribute("style", "transform:translateX(-" + move + "px);");

  }

}

link to the script is here: http://jsfiddle.net/lexin31/zk7acx0q/10


Viewing all articles
Browse latest Browse all 67527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>