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