Set up two Content Area Off Canvas in the same page

Hello guys. Need your assistant here.

In my page, I would like to set up to Content Area Off Canvas. What I have done so far:

  1. I create the Off Canvas, set a Class for it and add some content to load

  2. I create a button and set a class

  3. I have the ajax call as follow:

    jQuery(function($){
    $( document).on(‘click’, ‘#menu-item-119 > a, .callBookNow’, function(e) {
    e.preventDefault();
    $(’.x-anchor-toggle’).click();
    })
    });

The problem is: When I created another Content Area Off Canvas with a different content once you press the the button to call the calendar end up both Off Canvas been call

I tried setting up a different ID for each Off Canvas but still not working.

Kind confuse, but please check the secure notes for URL and credentials

Hi There,

I could see that you’ve already assigned the ID and class to your anchor toggles.

You should separate the custom JS like this:

jQuery(function($){
	$( document).on('click', '.callBookNow', function(e) {
		e.preventDefault();
		$('.robertCalendar').click();
	});
	$( document).on('click', '.callMessage', function(e) {
		e.preventDefault();
		$('#robertMessage-anchor-toggle').click();
	});
});

Hope that helps and thank you for understanding.

Thank you Sir. You nailed it.

Glad I was able to help :slight_smile:

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