Page 1 of 1

event move

Posted: Sun Dec 17, 2023 6:12 am
by SergeFog
Why the "event move" works from left to right but not from top to bottom, up and down.

Re: event move

Posted: Sun Dec 17, 2023 8:05 am
by Pablo
To be able to help you, I need a DEMO project (.wbs file) so I can see all your settings.
Also, please include a description how to reproduce this problem.

I do not need the complete project because that will only take more time to figure out what you have done.
Basically, I just need a small project with one page and object(s) that are relevant to your question.

For further details about how to share a project file, please see this FAQ:
viewtopic.php?f=10&t=82134

Image

Re: event move

Posted: Sun Dec 17, 2023 9:57 am
by SergeFog
here you can get my demo (TEST)
https://1drv.ms/f/s!ApAbEGiZoD9vx2Y3gog ... j?e=PyYwyO
By using the menu I can change the "text window".
But if I move the text1 up and down and change the text1 to text2 , the text2 is not at its beginning.
The "event move" Don't work.

Re: event move

Posted: Sun Dec 17, 2023 10:24 am
by Pablo
The 'move' event seems to be working in your demo.
Note however that you are moving the object to 0,200, but that the object is already at that position so nothing will change!

What did you expect to happen?
Can you please be more specific?

And why not use a carousel instead? In that case, you only need one event instead of this complicated layout.

Re: event move

Posted: Sun Dec 17, 2023 1:10 pm
by SergeFog
You must move up the object to 0,0 or less and then change the object.
this object is also at 0,0 or less and not on the 0,200

Re: event move

Posted: Sun Dec 17, 2023 1:28 pm
by Pablo
I'm sorry, it is not clear what you want to do?
With your current settings, what did you expect to happen?

Re: event move

Posted: Sun Dec 17, 2023 4:51 pm
by SergeFog
1 - I scroll the text 1 upwards.
2 - Then I change to text 2.
Text 2 should be at 0,200 but it shows the height that text 1 was:
The "event move" didn't work.

Re: event move

Posted: Sun Dec 17, 2023 5:03 pm
by Pablo
In the example you have shared, the event move event does work.
However, because the element is already at position "0,200", nothing will happen.

Note: "move" sets the position of an element, it does no scroll text!

Code:

Code: Select all

function MoveObject(id, left, top)
{
   var elem=document.getElementById(id);
   if(elem)
   {
      elem.style.left=left+'px';
      elem.style.top=top+'px';
   }
}

Re: event move

Posted: Sun Dec 17, 2023 10:04 pm
by SergeFog
how to use this code?
Can you fix my demo?

Re: event move

Posted: Mon Dec 18, 2023 7:17 am
by Pablo
This code is automatically used when you select the 'move' event.
There is no need for a fix. The point of showing is, that this explains how it works.

If you need further assistance then please try to be more specific.
It is still not clear why you think it does not work. In my opinion, the demo you have share works correct.

Re: event move

Posted: Tue Dec 19, 2023 1:32 pm
by SergeFog
In the demo you have a menu and 3 texts, two of which are hidden. With the menu you can move from one text to another. If I move the text up so I can read the bottom of the text and change the text, the new text is at the same height as the previous text. And this despite the “event move” which does not change the initial position, i.e. 200px.

Re: event move

Posted: Tue Dec 19, 2023 2:22 pm
by Pablo
These are the properties of the event in your project:

Image

However, object 'text1' is already at position 0, 200, so nothing will change.

Image

To see how it works, use different properties. For example: 0, 300

Re: event move

Posted: Thu Dec 21, 2023 9:10 pm
by SergeFog
But if I scrool up "text1", the "text1" is no more at 200px height, and when I change to "text2", "text2" also is not at 200px height.

Re: event move

Posted: Thu Dec 21, 2023 11:30 pm
by BaconFries
@SergeFog Hasn't this or a similar question already been asked by yourself over a year ago? Did you resolve it?. Please see all replies from Pablo. Events - move

Re: event move

Posted: Fri Dec 22, 2023 7:02 am
by Pablo
As previous mentioned, the 'move' event moves the object to an absolute position on the page as explained by the code. It does not scroll the page or the text.
That is just not how it works.

Re: event move

Posted: Tue Dec 26, 2023 5:10 am
by SergeFog
I haven't received any help on this topic.
Not a year ago and not now.

But if I scroll up "text1", the "text1" is no more at 200px height, and when I change to "text2", "text2" also is not at 200px height.

Re: event move

Posted: Tue Dec 26, 2023 8:02 am
by Pablo
If you scroll text, then the text object (container) does not move. The object stays at it's original position.
But if I scroll up "text1", the "text1" is no more at 200px height, and when I change to "text2", "text2" also is not at 200px height.
I am not sure what you means by this?
But why don't you use one of the standard panel containers, like a tab or carousel?
In my opinion, you are making this too complicated for yourself.