mercredi 27 mai 2015

show hidden div with jquery by url

i am us jquery to show/hide divs by button click which works well but i would like to be able to show the div using a url: eg: http://ift.tt/1AxLlBA

This is the jquery i am using:

$(function(){
$('#Options ul li a').on('click', function(e){
e.preventDefault();
var newcontent = $(this).attr('href');

$('#Options ul li a').removeClass('sel');
$(this).addClass('sel');

$('#Info section').each(function(){
  if(!$(this).hasClass('hidden')) { $(this).addClass('hidden'); }
});

$(newcontent).removeClass('hidden');
});
});

Any suggestions please.




Aucun commentaire:

Enregistrer un commentaire