I need your help (I know, again… ). I have been trying to figure out something for the last few days unsuccessfully, I might add.
I am running some tests, you know, trying things out, and there is something I am missing. I created two different containers, one for general information (GeneralInfo_Cont) and one to display a message about the cookies (CookieMessage _Cont). Both of them are created dynamically (GeneralInfo and CookieMessage ) when the main page is loaded. Now, I am trying to achieve a few things:
I want GeneralInfo to appear first and when the page detects that the cookies are disabled, I would like to use WebAnimation to move GeneralInfo down and to have CookieMessage appear from the top, taking the space left open by the other container. The reason for this is to try and get the user’s attention about a message that I want him to read. For whatever reason, both containers appear at the same time, even if I put a long delay in the move animation. I tried different things but I never got it to work.
The other thing I would like to do is the reverse. On the CookieMess, there is a button for the user to close the message. I would like, when the user presses that button, for both items to move up, making CookieMessage disappear. For some reason, probably because I am using the wrong code, I am unable to access the WebAnimation in the GeneralInfo item.
Could someone point me in the right direction?
As usual, many thanks for your advice
UPDATE: I was able to get it working the way I want by dragging the two containers directly on the WebPage and having the CookieMessage with a Top setting as a negative number. But I think it would be best if I could create dynamically the control in order to keep the page not too crowded. It is possible that I will not need this CookieMessage so I would rather create it as needed.
OK, need your help. I was able to create a simple app that shows what I am trying to achieve. The file can be downloaded at Test File. It works when I create the two containers on the Webpage directly. But, what I aiming for is creating the two items dynamically and that is where I am stumped. As soon as I create them, the animation is wrong and I am unable to access them so when the button in the yellow part is clicked, I want to move both items at the same time so the yellow part disappears. But I can’t seem to find a way to access the items once they are created or, while Xojo is building the app, it gives me an error saying it does not exist. Normal, since it has not been created yet…
Can you help?
Do not Dim them. Instead, add to your webpage container properties that will reference the newly created webcontainers.
myWC as WC1
Then you create it as
myWC = new WC1
It worked. so, on to the next step.
Geez… Can somebody run this on his computer and tell me if he/she sees the same thing I do.
As mentioned above, I want to create a way that when cookies are disabled on the user’s browser, the site will show a message. Eventually, I want it animated in a way that both the cookie message and the main part moves down, displaying the cookies message. I was able to set it up and it works.
I am having issues aligning the elements. I deleted all the extra bits and pieces in order to keep only the part where it shows the two elements in question, trying to figure out where the problem was but I could not find anything. Since I want the main part to be always there, I put the commands in the Open event and I put the cookies message commands in the Shown event, so it will appear only after the page is drawn and after I was able to check if the cookies are enabled or not. Now, there is a difference of 8 pixels in the alignment even though I am using the exact same commands. Furthermore, the main part will move when the window is redrawn but not the cookie part. Both of them will align if I put all the lines in the Open or Shown event but then, the animation does not work properly.
Now, I am trying to ascertain if the issues in with my computer, my browser or even my installation of Xojo so that is why I would really appreciate it if somebody could run it on his computer so I can rule out those possibilities. Obviously, if you happen to know why it is behaving this way, I would also appreciate the explanation…
The test file can be found here: Test file
Thanks a lot