Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Use viewport size in a setvar
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: Use viewport size in a setvar
You can't.  Template conditionals are completely server side, Javascript is client side.

You can write template variables into Javascript eg

Code:
var imgUrl = <?=json_encode($GLOBALS['threadfields']['coverpic']['value'])?>;

but not the reverse (without making additional requests).

You'd probably have to write the code in Javascript.


My Blog
06-03-2014 09:57 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Use viewport size in a setvar - leefish - 06-02-2014, 01:20 PM
RE: Use viewport size in a setvar - ZiNgA BuRgA - 06-03-2014 09:57 AM

 Standard Tools
Forum Jump: