Opening off-canvas content with an alternative link

Hello Themeco!

I’m using an off-canvas content area to create some detailed foot notes in an article. I’ve had no problem working with element itself, but I would love to put an inline superscript in the text body that ALSO opens up the off-canvas area (basically creating one of these (1) with a link that activates the off-canvas area). Is this possible? I’ve tried using custom id to link the superscript to the anchor toggle, but that just brings you to the toggle itself, rather than opening it up.

Thanks, and cheers.

Hi there,

Thanks for writing around! Can you please refer to the following thread https://theme.co/apex/forum/t/how-to-link-a-menu-option-with-content-area-off-canvas/20058 this might help you in getting started.

Hop this helps!

Thanks! I should have mentioned, I already read that post. But because I’m not using a button or a menu item, I don’t know how to target the initial link. I can understand how I’d add Java script to target a specifically ID’d off-canvas area, but I want the clickable portion to simply be a section of text. For example, I would want this dummy link within my text to open up the off-canvas portion.

Hi,

You can add a unique class to your link.

eg.

<a href="#" class="my-button">this dummy link</a>

Then use that class in your js script


jQuery(function($){
  $( document).on('click', '.my-button', function(e) {
    e.preventDefault();
    $('.x-anchor-toggle').click();
  })
});

Hope that helps

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.