Set as active next or previous submenu
I'm working with this jSFiddle: https://jsfiddle.net/vkuz8ra3/
And i need function which active next or previous link after click to div prev or div next.
I tried something like this but it does not work
- jQuery(document).ready(function($) {
- $('.prev').click(function() {
- $('#links').children().prev().addClass('active');
- var index = $('#links').children().index('#links');
- $('#linksobsah').children().hide(500).eq(index).show(500);
- $('#links').children().removeClass('active');
- $('#links').addClass('active');
- });
- });
I would be grateful if someone can help me Thank you :)