Logic Machine Forum
When a page is opened make a task - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: When a page is opened make a task (/showthread.php?tid=2269)



When a page is opened make a task - Mirco - 08.10.2019

Hi,
is there a way to know when a page is opened in javascript? Because I want to change the color of an object when this happened.
I already know the code to change color Wink 

Thank you!


RE: When a page is opened make a task - Daniel - 08.10.2019

Hi
Based on what do you want to change the color? JS runs when you open the page.
BR


RE: When a page is opened make a task - buuuudzik - 08.10.2019

You can add js script and update some object whenever you open a page maybe with some filter to not updating too often. Then you can check color some icon based on how much time elapsed from last update.


RE: When a page is opened make a task - Mirco - 08.10.2019

This is my problem:

I have a menu where I use "link visu-object" to open different page.
When I open a page the image of the "link visu-object" change in "pressed" and is correct. Inside this page I have a sub-menu with 3 pages using "link visu-object".
Now when I pressed a sub-menu page the related "link visu-object" change in "pressed too, but the "link visu-object" of the main menu returned with the image "not pressed".

Now I tryed to put, in the sub-menu page, the same "link visu-object" of the menu with the images reversely but the effect is horrible, when you change page the image of the "link visu-object" of  the menu flash few times.

So I would like to change the background color of the "link visu-object" when a page is opened, so I don't have to use multiple "link visu-object" one above the other and I will resolve the flashing images that are changing

Hope you can understand, because it's hard to explain, sorry

(08.10.2019, 13:10)buuuudzik Wrote: You can add js script and update some object whenever you open a page maybe with some filter to not updating too often. Then you can check color some icon based on how much time elapsed from last update.

How can I add a js script when I open a page?


RE: When a page is opened make a task - Daniel - 08.10.2019

So you want to modify the link background based on which plan is open right?
Here is how to check which plan is open
https://forum.logicmachine.net/showthread.php?tid=275&pid=7043#pid7043


RE: When a page is opened make a task - Mirco - 08.10.2019

Thank you very much! It works! Big Grin