It's really not very practical to remember a lot of state about an unknown set of elements' positions in the DOM.
If you're prepared to require Javascript on the site, just use .show()
and .hide()
and then use jQuery instead of static CSS to assign a class or CSS properties to the first :visible
child.
var state = false;
$("button").on('click', function () {
var $a = $('article');
state = !state;
var fn = state ? 'hide' : 'show';
$a.not('.1')[fn](); // calls 'hide' or 'show' depending on state
$a.removeClass('highlight').filter(':visible').first().addClass('highlight');
});