简体   繁体   English

在响应式 Joomla 模板的桌面视图和移动视图之间切换

[英]switch between desktop view and mobile view for Responsive Joomla Template

I use responsive joomla template for my joomla website.我为我的 joomla 网站使用了响应式 joomla 模板。

How can I do to make visitor can choose or switch between desktop view and mobile view when they visit using mobile device?如何让访问者在使用移动设备访问时可以选择或在桌面视图和移动视图之间切换?

Sorry for my bad english.对不起,我的英语不好。 Hope you understand what I mean... Thank you....希望你明白我的意思...谢谢....

Make a separate css file and put all the css media query in that file and put the below code to head section of your template index file.制作一个单独的 css 文件并将所有 css 媒体查询放在该文件中,并将以下代码放在模板索引文件的head部分。

$fullsite = $_GET['fullsite'];
if ($fullsite == 1) {
    echo '<link rel="stylesheet" href="media.css">';
}

Now use the this code for making a switcher.现在使用此代码制作切换器。 you can put this code to the footer section.您可以将此代码放在页脚部分。

if ($fullsite == 0) {
    echo '<a href="index.php?fullsite=1">Mobile Site</a>';
}else{
    echo '<a href="index.php?fullsite=0">Full Site</a>';
}

I hope it will help you.我希望它会帮助你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM