Blogger Ever

Accessibly rotate content using jQuery

A simple way to rotate content on link click.
Clicking some button in some container changes the container. Forms are most common example of them, when submitting button turns the whole form into another form or thanks message. Its quite easy to make have a look at demo.
See the Pen Accessibly rotate content by Mohammad Hamza Dhamiya (@hamzadhamiya) on CodePen.

Initially when I tried it using plain Javascript, what I found was a long complex codes with loops and several function but an easy approach using jQuery is way more better.
Initially hide the container with the above code and make the first one appear. Then using a click function access the parent of the link and check the data attribute.
  if ('target') == 'next') {
    }else if('target') == 'prev'){
Show the next or previous container of the parent and then hide the current one. Check this below demo of one of the my previous post published on this blog.
See the Pen Sliding Multiple Tabs with Arrow navigation by Mohammad Hamza Dhamiya (@hamzadhamiya) on CodePen.

2013-2016 Copyright Blogger E\ver . Coded, managed and founded by Mohammad Hamza (@hamzadhamiya) . Hosted on Blogger and fonts used are Raleway and Open Sans.