Все компоненты отключаются | All components are switched off - Forum

Forum Navigation
You need to log in to create posts and topics.

Все компоненты отключаются | All components are switched off

я пытался использоваь neoscroll, но он не работает.
поэтому я решил использовать js, и как выяснилось эти две комманды вырубают все компоненты

I tried using neoscroll, but it didn't work.
So I decided to use JS, and as it turns out, these two commands disable all components.

BeginJS
location.assign('#ContainerAboutMe');
window.location.href = '#ContainerAboutMe';
EndJS

 

@lolo You’ve bumped into a classic gotcha. Changing the URL hash with:

BeginJS
location.assign('#ContainerAboutMe');
window.location.href = '#ContainerAboutMe';
EndJS

forces the browser to do an anchor jump. In VisualNEO Web that can interfere with how the app attaches events to objects, so it looks like everything gets “disabled”. Instead of touching location, use VisualNEO’s scrolling commands (they’re built exactly for this) or use a safe JS scroll that doesn’t reload/retarget the page.

Here are reliable options:

1) Scroll the whole app to your object (recommended)

neoScrollAppToObject "ContainerAboutMe" 600

This smoothly scrolls the app to the object in ~0.6s. See the neoScroll commands in the help: neoScrollAppToObject, neoScrollAppToNumber, etc.

2) If the target lives inside a scrollable Container

neoScrollContainerToObject "OuterContainer" "ContainerAboutMe" 600

That scrolls only the container, not the entire app. The neoScrollContainerToObject and neoScrollContainerToNumber variants are documented in the same section.

Tip: When you make a scrollable container, give it overflow-y:auto in its Style so it can actually scroll; you can also apply neoScrollBars on PageEnter if you want prettier scrollbars:

neoScrollBars "OuterContainer" "minimal"

Tutorials show this pattern (calling neoScrollBars on PageEnter) and styling the container with overflow-y:auto.

3) If you still prefer JavaScript, avoid changing location

Use scrollIntoView (smooth, no hash change, won’t break components):

BeginJS
var el = document.getElementById('ContainerAboutMe');
if (el) { el.scrollIntoView({ behavior: 'smooth', block: 'start' }); }
EndJS

Quick checklist

  • Don’t use location.assign() or window.location.href = '#...' inside VisualNEO apps for in-page scrolling.

  • Prefer neoScrollAppToObject / neoScrollContainerToObject for smooth, controlled scrolling.

  • For scrollable containers, add overflow-y:auto and optionally neoScrollBars for nicer UI.

If you want, tell me whether ContainerAboutMe is top-level or inside another container, and I’ll drop in the exact line you can paste into your object’s Click or PageEnter event.

lolo has reacted to this post.
lolo