|
Javascript If statement
Hey guys, I am having trouble trying to merge two codes together to give me a basic if statement. So If the user is a mobile user, include header_mobile.php , else include header.php . I am trying to do this to sort out my navigation bar as mobile users can't view my drop down menus on my navigation bar, due to not having the hover function with touchscreens. Here are the two codes I have I just can't seem to merge them , any help would be great!
Javascript If Statement
<script type="text/javascript">
$(function() {
if( /Android|Mac|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) {
$('.mobile').show();
}else{
$('.desktop').show();
}
});
</script>
PHP Include
<?php include("header.php"); ?>
|