How can I toggle when I add #ID at the end of the URL? For example when I access a URL like domain.com/xxxxxx#01 then my div will show.
$(document).ready(function() {
$(".toogle_button_<?php echo $link_shs['no_e'] ?>").click(function() {
$("#<?php echo $link_shs['no_e'] ?>").slideToggle();
});
if (location.hash) {
var id = location.hash.slice(1);
var elementToShow = $("#" + id);
if (elementToShow.length) {
elementToShow.slideToggle();
}
}
});
#01 is the id from $link_shs['no_e'].