I'm struggling to get this to work and have tried several solutions offered by different questions like: Display live width and height values on changing window resize
php echo statement if screen is a certain size
+more but no point linking, you get the point.
I'm not sure why I am not able to get it to work as intended...
Here is what I am trying to accomplish. On this page: http://www.websitebuilderexpert.com/website-builders-comparison-chart/ If you are looking at it in google chrome and resize your browser window as if your looking at it on a mobile phone a message appears. That's what I'm trying to accomplish. Is that message appearing at a certain innerwidth.
On my page I do use jquery: <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
I was trying some inline javascript like:
<script type="text/javascript">
if( window.innerWidth < window.innerHeight) {
echo 'Try the mobile version: <a href="example.com">click here</a>';
}
</script>
This seems like the preferred method
also tried:
<script type="text/javascript">
if( $(window).width() < 600 )
{
echo 'print something';
}
</script>
I'm definitely a noob when it comes to javascript so I don't really know what I'm doing other than trying a whole bunch of suggestions I have found here.
Can anyone point me in the right direction or provide some guidance? I would very much appreciate it! Thank you for your time and consideration.