i want to create (some kind of) a fullwidth slider, where i have a flex-wrapper with several child sections. each seaction is 100vw arranged in a row. now i want to move the flex-wrapper with margin-left 100% everytime you click on a button. it should not add it one time, it should stack up like 100%, click, 200%, click, 300% and so on...
i came up with the following.
$(document).ready(function() {
$('.button').click(function() {
$('.section-wrapper').css('margin-left', '+=100%');
});
});
it doesnt seem to work. when i replace 100% with 1920px it works as intended. (on my fullhd monitor)
any ideas?
EDIT: heres my codepen, i hope its getting clearer now: https://codepen.io/tuxedo/pen/gOazMxv