I need a little help with the following concept:
I have little colored divs scattered around a page, their position calculated based on the width of the window. I need to get the width of the window to php to run the algorithm that determines the position of the divs. And when the page is resized I need to get the new width to php so that the positions of the divs can be recalculated.
I currently have a link with a javascript embedded which gets the window width and passes it as a GET. This works, as long as you click twice on the link. (The first click overwrites the previous width value, but the calculation is not updated. The second click uses the new value in the calculation).
This is a bad method (BAD METHOD! BAD! BAD!).
There must be away to set a variable when the page loads, then check the value of the variable and refresh when it is a certain value.
I'm having difficulty thinking through the logic.
Thanks
B