Sticky Element

Is there any way to make an element (e.g. Button) Sticky with Blocs? I’m not talking about the Nav menu, but an element in the content. I found a simple script here: http://stickyjs.com/ but for those like me, who doesen’t understand much from codes is’t still not understandable.
Could anyone please check if this will work with Blocs and eventually post a tutorial?
Many thanks!

2 Likes

I second the request! Please someone help with a tutorial!

Its quite easy to implement, but it may cause a problem with other parts of the page.

Essentially, download the plugin and open one of the examples in a code or plain text editor. Now copy the head code from “Title Sticky Plugin” to the closing script tag. Paste this code to the head of your Blocs Page.

Add a Div bric to your page wherever you want to place the sticky element. Give the Div an id of sticker

You now create your sticky content inside the Div.

Publish the page to disk and add the jQuery.sticky.js to the folder where you published your site.

Preview the page in a browser and you should see that the sticky content sticks to the top of the page as it scrolls upwards.

This is where you may see a problem. The page content below the sticky content may scroll over, instead of under, the sticky content. This will have to be fixed. I’m not sure how at the moment, so I’ll get back if I find a solution.

Thanks, I gave it a try and it is as you say: the remaining content overlaps the sticky element!

However, and on a side note, user @gvchagas has built an awesome website using Blocs and this plugin and everything works flawlessly: I Updated My 3D Portfolio Site