I have a button:
<div id="headBtn"> </div> I have a class:
.slideout { -webkit-transform: translate3d(265px, 0, 0); position:absolute; left:0; transition: -webkit-transform .5s ease; } I have a function:
$('#headBtn').on('click',function(){ var wrap = $('#wrapper'); wrap.toggleClass('slideout'); }); The aim is to have my #wrapper element move to the right using webkit-tansform, I then want to toggle that css so it snaps back to the left again.
Right now the #wrapper element does snap back to the left for a second but it moves to the right again, as if the css is removed but then applied again.
Any ideas why this is happening?
on('tap',function(){ $(this).removeClass('slideout'); });this was on the wrapper element itself. SOrry for wasting your time. But you did confirm it wasn't the toggle function itself.