Answer the question
In order to leave comments, you need to log in
How to make one site but with different content for different devices?
Hello, tell me how to make one site but with different content for different devices? That is, if you open it on a computer, then there is one information, but if you open it on your phone, then another?
As an example, I can cite such a site bananix.ru.
Are there any constructors for these purposes?
Answer the question
In order to leave comments, you need to log in
If you want different content then use User Agent .
And with @media (CSS) as suggested above, this only allows you to adapt the size and style of the site to different screen sizes.
UPD: Try using JavaScript on constructors
<script type="text/javascript">
var mobiles = array["iPhone", "iPod"];//mobile devices
var i;
for(i=0;i< mobiles.lenght;i++){
//testing if the RE matches the mobile agents
var er = new RegExp(mobiles,"i");
if( er.test( navigation.userAgent ) ) {
window.location = "http://mobile.mysite.com/" ;
}
}
</script>
via media.
if the site is opened from a mobile phone or tablet, then other blocks are shown to it.
and what to place in these blocks is up to you
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question