Content Dock Link to Section

Hi there,
i´m trying to link from content dock widget to a section in other page, is this possible?

Hello @jlampreia,

Thanks for asking. :slight_smile:

Yes, that’s very much possible to link content dock to a section in different page. First you need to assign id to the section under Section > Customize. https://cloudup.com/cEMuJbM6kGB

After that add following JS code under X > Theme Options > Js:

jQuery(document).ready(function($){

$('.tco-content-dock').click(function(){
    location.href = 'http://example.com/about/#section15';
}); 

});

Make sure to replace website URL and the section id section15 http://example.com/about/#section15.

If you would like to learn more about Javascript, please take a look at following resource:

https://www.w3schools.com/js/
https://www.youtube.com/watch?v=fju9ii8YsGs

Thanks.

1 Like

Thanks Prasant, your answer is very well detailed.

I´ve applied the code and it´s working, but there´s a small problem, when clicking on the x to close content dock it goes to section too.

I think i found out a solution. I assigned id to the section and give url the section name ‘contactos/#section2’ and it´s working. There´s no need to JS code.

Glad you’ve sorted it out :slight_smile:

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