XF 2.0 Set a variable via js for use as template condition

Idhae

Active member
hello,
i would check a heigth of a div via js, then set this height to a variable to check this one in template condition.

Somebody an idea how i could realise this? Some Code examples how i could set the variable from js to <xf:set / <xf: page ?
Greets
 
Last edited:
JavaScript is executed on client side after the response has been passed off. Your server is long done executing template syntax and php by the time JavaScript even starts to run.
 
i found a way:
  • content loaded standard css "visibility: hidden"
  • JS check for heights
  • JS make the DOM Element css "visibilty: visible" if height OK, otherwise remove DOM Element.
 
Back
Top Bottom