A
A
Alexander2016-05-28 19:24:03
Android
Alexander, 2016-05-28 19:24:03

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

2 answer(s)
P
Print Pulse, 2016-05-28
@resulkuliyev

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>

D
Dmitry Krymtsev, 2016-05-28
@krimtsev

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 question

Ask a Question

731 491 924 answers to any question