can the menu move along with the mouse scroll down the view?


Yang Ghua

In Sample FixedContainer ,I attach a menu to the button (The Button is in the Container on the top of view,just like the Sample Menu2),
After click the button ,the menu popup up,but how can i move the menu while the view is scrolling down??just as the Buttons do?


DecSoft

Hello Joshua,

What about to use a Dropdown or Select controls instead a Menu one? Anyway, right now we have no "scroll" events, but we can use "pure" Javascript to attach some app's function to some possible "scroll" event of the app's view. Take a look a this article and please tell me if you have any further questions.



Yang Ghua

Use Dropdown,the popup menu still not follow with the Dropdown Button while view scrolling down

and to the article
you mean:Menu2.onscroll = function(){myScript};??


DecSoft

Hello Joshua,

Certainly something like the below (placed in the view's Show event) do not work as expected:

Can you provide here a little app sample sir? Maybe with a bit of CSS we can get the menu acting like you wanted.



Yang Ghua

in View1 showevent

And I create a Function in ABscript name 'scroll_set_popmenu_position'

This seems the fuction will be called while 'Scrolling',but the menu position is not right!
:| and =|


DecSoft

Hello Joshua,

I am not sure if attach an "scroll" event to the "window" can be good here. Anyway, can you see what "[ButtonTop]" and "[ButtonLeft]" store? When the menu is shown? When is hide? Honestly I can't figure out exactly what you wanted, I am sorry for that.

Can you please provide here a little app sample so we can take a look?



Yang Ghua

in fact ,all I want to say is that:
In Sample FixedContainer,if I popup a menu by click the button(or use Dropdown Button)
while the popup menu still visible ,
and I do 'MouseDown' action,the popumenu does not follow the button move downforward


DecSoft

Hello Joshua,

Thanks. Finally I think I got it. Please, loot at the below attached sample:

FixedContainer.ab

Press the first top button and you can see a Menu. Scroll down the app's view and now the Menu continues there. The "trick" is made by set the "position = fixed" to the Menu, as you can see in the sample's "Inline CSS" option. Hope this can help you in some way.

P.S. Anyway, consider to use an entire view for menus. Some menus can be implemented like that and for sure its a good way to do it, showing the "menu" view as a dialog or not.



Yang Ghua

Oh,this work! :)
I know the 'entire View for menus',but i want to try some different ways

and will this 'position = fixed' will work with Dropdown Button's menu too?


DecSoft

Hello Joshua,

Yes; apparently the same "trick" can be used with a DropDown button in the same scenario. Take a look at the below sample:

FixedMenu.ab

However, this time we set the "position = fixed" to certain CSS class... and maybe this can interfere in some others DropDown controls.



Yang Ghua

excellent!Thanks you very much!


DecSoft
excellent!Thanks you very much!

You're welcome sir! :)


Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

This website uses some useful cookies to store your preferences.

I agree. Hide this note. Give me more information.