a href="#" adds current site, anyway to disable it?

rivacom

Active member
I'm trying to setup a series of menus and div content on a xenforo page. However, anytime I create a link with #, it just adds my url infront of the #. Anyway to disable this for pages?
 
I'm trying to setup a series of menus and div content on a xenforo page. However, anytime I create a link with #, it just adds my url infront of the #. Anyway to disable this for pages?

That's what using # in the href is supposed to do, what is it that you're wanting to do?
 
That's what using # in the href is supposed to do, what is it that you're wanting to do?

I have a Menu and when I click say menu link 1, it loads a div content using jquery. From my understanding(which I guess maybe i'm overlooking something) # has always been a bookmark reference, not reloading the page but rather looking for a ID with the same name.
Javascript
Code:
<script>
$(document).ready(function () {
    $('#menu').on('click', 'a', function () {
       if($(this).closest('li').hasClass('current')) return; $('.current').not($(this).closest('li').addClass('current')).removeClass('current');
        // fade out all open subcontents
        $('.pbox:visible').hide(600);
        // fade in new selected subcontent
        $('.pbox[id=' + $(this).attr('data-id') + ']').show(600);
    }).find('a:first').click();
});
</script>

Link
HTML:
<a href="#heroes">

Div
Code:
<div class="pbox" id="heroes">
 
Last edited:
Back
Top Bottom