So I currently have this piece of code:
if(direction === "right" ) { var signOne = '-'; var signTwo = ''; }
if(direction === "left" ) { var signOne = ''; var signTwo = '-'; }
innerWork.not('.active').css({'left': signOne + '450px'}); // Move the not active text to the left
innerImg.not('.active').css({'left': signOne + '370px'}); // Move the not active images to the left
where the right or left gets passed through the function. And what I want to happen, and it works as expected is that if the function is given says right, then it makes the two left values minus and if the function is run with "left" then it gives positive values.
As I said, it all works but JSHint/Lint throws up errors about, a) the variables being defined twice and b) that the variables are being used out of scope. Is there a neater way to achieve what I want that would be syntantically correct?