امتیازها
113
راهحلها
27
- محل سکونت
- England
- نوشتهها
- 26,276
- تاریخ ثبتنام
- ۱۳۹۹٫۰۴٫۰۶
- پسندها
- 3,286
- سن
- 29
- وب سایت
- xenforo.xyz
- نسخه PHP
- 7.3
- نسخه زنفورو
- xenforo 2.2
I need to run a code according to the screen size.
So I've put the JS inside XF var and if I "alert" or "console.log" I can see the variable, but when calling the variable in XF it returns nothing.
How to correctly read the XF variable in this case?
Code:
So I've put the JS inside XF var and if I "alert" or "console.log" I can see the variable, but when calling the variable in XF it returns nothing.
How to correctly read the XF variable in this case?
Code:
کد:
<xf:set var="$screen"><xf:js>window.innerWidth;</xf:js></xf:set>
<xf:if is="{$screen} > 650">
...... code .......
</xf:if>
