mardi 26 septembre 2017

Conditional php - javascript innerWidth isn't working Laravel [duplicate]

This question already has an answer here:

I'm trying to change the value of $i in the following conditional:

("<script> document.write(window.innerWidth) </script>" > 960)? $i = 2 : $i = 3

But, I have always the same result "3" in diferents width of screen. Any idea?

EDTITED My objective is change the value of chunk in a foreach, this is the complete part:

{!! ("<script> document.write(window.innerWidth) </script>" > 960)? $i = 2 : $i = 3 !!}

@foreach ($data['news']->chunk($i) as $chunk)
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 pad_inf_2">
    @foreach($chunk as $new)
        <div class="col-xs-12 col-sm-6 col-md-4 col-lg-4 pad_der_1">
            <article>
                // ---
            </article>
        </div>
    @endforeach
</div>
@endforeach



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2xthg9G
via IFTTT

Aucun commentaire:

Enregistrer un commentaire