I’ve implemented the original solution on a client site of mine, works great even within multiple tabs:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.pjax/2.0.1/jquery.pjax.min.js"></script>
<script>
var containerSelector1 = '#seamless-replace1';
$(document).pjax(
'#w-pagination-wrapper1 a',
containerSelector1,
{
container: containerSelector1,
fragment: containerSelector1,
scrollTo: false,
timeout: 2500,
}
);
var containerSelector2 = '#seamless-replace2';
$(document).pjax(
'#w-pagination-wrapper2 a',
containerSelector2,
{
container: containerSelector2,
fragment: containerSelector2,
scrollTo: false,
timeout: 2500,
}
);
var containerSelector3 = '#seamless-replace3';
$(document).pjax(
'#w-pagination-wrapper3 a',
containerSelector3,
{
container: containerSelector3,
fragment: containerSelector3,
scrollTo: false,
timeout: 2500,
}
);
var containerSelector4 = '#seamless-replace4';
$(document).pjax(
'#w-pagination-wrapper4 a',
containerSelector4,
{
container: containerSelector4,
fragment: containerSelector4,
scrollTo: false,
timeout: 2500,
}
);
// These 3 lines should reinitialize interactions
$(document).on('pjax:end', function() {
Webflow.require('ix2').init();
});
</script>
However, I’m trying to implement a function on mobile that scrolls back up to the top of the collection list (tabs menu) since I’m showing 3 list items at a time, which are taller than the mobile device viewport:
<script>
$("#next-seamless").click(function() {
$([document.documentElement, document.body]).animate({
scrollTop: $("#tabs").offset().top
}, 2000);
});
$("#back-seamless").click(function() {
$([document.documentElement, document.body]).animate({
scrollTop: $("#tabs").offset().top
}, 2000);
});
</script>
It works the first time you call it, but never a second time… anybody got any idea on what I’m missing?
Here’s the read-only link: https://preview.windwer.shop/preview/udc2?utm_medium=preview_link&utm_source=designer&utm_content=udc2&preview=d88d261764d5b131e3557909f3301b1b&mode=preview
Here is the section in question on the page: 柏アーバンデザインセンター (UDC2) | トップ (“AND MORE…” button)
Cheers everyone and thanks to @forresto for the original solution
/ John
Edit:
Hello…
Guys…?
Does javascript guru @samliew still roam around here?
Edit2:
Is there a Webflow discord channel or something thats active?