Floating sidebar

Hello everyone.

We are trying to install the “sidebar” always visible Unsuccessfully :frowning:

The idea is that the sidebar is floating.

Could you help?

Thanks you so much everyone.

Benjamin

Hi Benjamin,

That will require some custom coding, and you should contact Codeable for more advanced customisation.

You can try to follow this guide http://www.wpbeginner.com/plugins/how-to-create-a-sticky-floating-sidebar-widget-in-wordpress/, and to try to achieve that with a plugin.

In addition, we have prepared custom JS code below, and this is best we can offer regarding this. You can add the code below from theme folder / js / scripts.js file or through some JS plugin:

// sidebar floating
jQuery(function($) {
	if ($('div#secondary').length) {
		$(window).scroll(function(){
		    if ($('div#secondary').height() < $('div#primary').height())
		    {
		    if ($(this).scrollTop() > 90)
		        $('div#secondary').animate({"marginTop": ($(this).scrollTop()) - 100 }, 100);
		    else
		        $('div#secondary').animate({"marginTop": ($(this).scrollTop()) }, 100);
		    }
		});
	}
});

Result should look like this http://screencast.com/t/QUpLwQMbCFsM

Best Regards

Thank you. I will contact them.

Best Regards.

Benjamin

You’re welcome,

Best Regards