Streaming live at 10am (PST)

Connect the Checkbox with a page element for scrolling

I used the tutorial created by @sabanna to create a filter with Mix It Up.

The issue is that when the content is filtered. The user is scrolled to the end of the page, because the height of the collection changes, followed by height of the section.

Is there a way to scroll to the top of the section (any element, Preferably the Read More button) when a checkbox is clicked.

I searched the forum and looked through the editor but couldn’t find an option to link the checkbox with a page section.

Read Only:

Any kind of help is really appreciated. :pray:

I found something that might work, but don’t know how to implement it:

    $('input').on('ifChecked', function(event) {

   // Fixed scroll target       
   const target = $('#target');

   // For dynamic targets: adjust the target selector like
   // const target = $($('name');

      scrollTop: target.offset().top
   }, 1000);

Is there someone with a bit of experience with this?

Hey there @Arialwal! Thanks for thinking of me to help you out!

Can you please drop this code before the “/body” tag? Let me know if it fits your needs!

const target = $("#SCROLLED");

function scroll() {
      scrollTop: target.offset().top

$("input[type=checkbox]").click(function() {
  if ($(this).prop("checked")) scroll()
1 Like

Yes this worked exactly as I wanted it to be. Thank you so much @Jeandcc :smiley:

1 Like

Great! I’m glad to help