Forums

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

Home Forums JavaScript Any way to stop the “skip up”?? Re: Any way to stop the “skip up”??

#64408
Rob MacKay
Participant

Just to give you some food for thought too :)

instead of all that code you could bring it down to finding a class. If you give your boxes a class that matched the clicked element and the wrapping div around the boxes (has align centre in it at the mo) an ID of boxes, you could do something like:



$('div.infobutton a').live('click', function() {

var box = $(this).attr('class');

//given the div that wraps the boxes an ID of boxes :)

$('div#boxes').find('.open').fadeOut(000).removeClass('open').find('.'+box).fadeIn().addClass('open');
return false;

});

Dunno if this works but you can see how it removes lots of lines :D