hey guys,
i’m confused,
i have the following jquery script in my header:
forceAnim: <?php echo ($iphone || is_singular()) ? 0 : 1; ?>
which meanst, that either on the iphone or on a singular-type page forceAnim is 0.
However i want to include an additional query if a jquery cookie is saved.
if the jquery.cookie exists (and equals true) OR it’s viewed on the iphone OR its a singular type post forceAnim should be true.
i have just no idea how to mix php with jquery in that case. to query if the jquery.cookie returns true i can just use:
if($.cookie('animate') == 'true'){
//yes the cookie returns true.
}
any idea how i can query all three things?
thank you for your help.
@Joel Alejandro’s answer is incorrect (it accidentaly reverses the result of the first two conditions). Correct version:
This is parsed by PHP to either of this (with true or false respectively):
So forceAnim will be 1 only if none of the conditions are true (and will be 0 if any of them is true).
Truth table: