The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Slide Animation: Sliding Back

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
  • #167737

    The javascript animation below moves the .whole CSS class 200px (from left to right) when I click a button named .mobile-btn.

    What would I add to this script to make the animation slide back when the button is clicked again?

    <script type="text/javascript">
    $('.mobile-btn').click(function(event) {
        value = $('.whole').css('right') === '200px' ? 0 : '200px';
              left: value
Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.