Jump to content

Showing different custom field based on screen size


FlintHills

Recommended Posts

This solution works for displaying ads based on screen size.

 

http://www.reviewsforjoomla.com/forum/index.php?topic=22180.0

 

Is there a similar way to display custom fields based on screen size.

 

Something like this:

 

<script type="text/javascript">

    if (window.innerWidth >= 998) {

<?php echo $CustomFields->field('jr_fieldname_large',$listing); ?>

    } else if (window.innerWidth >= 520) {

<?php echo $CustomFields->field('jr_fieldname_med',$listing); ?>

    } else if (window.innerWidth < 520) {

<?php echo $CustomFields->field('jr_fieldname_small',$listing); ?>

    }
</script>

 

I tried this and it doesn’t work. Any ideas?

 

Thanks in advance,

 

Link to comment
×
×
  • Create New...