Can I have two different homepages on the same website?
P粉899950720
P粉899950720 2023-09-12 17:47:16
0
1
640

I am working on a project. I'm cloning a website Make My Trip

https://www.makemytrip.com/

This website looks different on laptops and phones, and I mean completely different. So how do we implement such a function.

This is the view on the laptop

The same website on mobile

P粉899950720
P粉899950720

reply all(1)
P粉041856955

The comprehensive answer depends on many factors that have not yet been disclosed. For example are you using a server side language like PHP and are all/most pages different?

Detecting whether a website runs on mobile devices is not simple.

One solution is

  1. Have a common index page, use JavaScript to get the screen size, and use Ajax to load the real mobile device page or desktop page

  2. Add a button/link to the page that allows the user to switch between mobile and desktop and saves the selection in a cookie/session.

Another option

I've seen some sites do this. A mobile version is always available by default and allows users to switch to desktop mode. The assumption here is that more people are using mobile devices, so the default setting will be correct for most people, and showing a smaller page on desktop is not as bad as showing a larger page on mobile .

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!