Looking to implement a sliding effect using style.setProperty in Javascript.
Below is the code snippet:
imageArray = [
'<img src="assets/bg1.jpg"/>',
'<img src="assets/bg2.jpg"/>',
'<img src="assets/bg3.jpg"/>'
];
var slideWidth = 300;
var slideHeight = 420;
var currentTranslation = -slideWidth;
function init() {
imageArray.style.webkitTransition = '-webkit-transform 1200ms';
getArray();
}
function getArray() {
for (var i = 0; i < imageArray.length; i++) {
$('.inner-image').append(imageArray);
/*not sure if this is relevant
imageArray.src = ary[i].media.m;*/
}
}
Being new to programming, acknowledge any syntax errors or inconsistencies in logic. Appreciate your assistance.