Link to home
Start Free TrialLog in
Avatar of ichauch
ichauch

asked on

Detect the state of Spry Effects

Hi Everybody

How can one detect the current state of a Spry effect (for example the slide effect)?
The problem seems to be that the state of the slide effect is lost when a page is refreshed or called newly after the slide effect has been executed. That leads to a problem when the effect is setup to allow "toggle". Example:

I slide down an initially invisible table by hitting the "hide/show" button. The table appears but contains a "next 25 items" button which refreshes the page to show the next 25 items pulled from a database. Now, if I hit the "hide/show" button again to toggle the table away (hide) again, the button, instead of sliding the table back up again, actually executes the initial effect of sliding it down (because after the page refresh it was initiated to the original state which is "up".

How can I make the spry slide effect "remember" the last state of the effect after the page is refreshed. Is there a way I can hand the state over to the next page by means of a variable, or ist there a way I can have the next page read out the last state of the slide effect?

Thanks for the help.
ASKER CERTIFIED SOLUTION
Avatar of Jason C. Levine
Jason C. Levine
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ichauch
ichauch

ASKER

Hi Jason. Thank you for your input. I have indeed in the meantime resolved the problem with a little piece of PHP code which simply replaces the desired Spry commands in the generated page depending on the data displayed in the table. Admittedly not the most elegant solution since it does refresh the whole page, it but works solidly and avoids adding/modifying the JS in the page. No other widgets or effects are being used so that I don't have to take them into account. But again, it could have been done more elegantly for sure.
Thanks again.
Elegance can be overrated.  If it works, it works.