简体   繁体   English

jQuery:根据屏幕分辨率交换HTML部分

[英]Jquery: Swap out HTML partials depending on screen resolution

With the current project I am working on (Using Bootstrap 3), the client has asked for major changes to the structure for mobile views. 在我正在处理的当前项目中(使用Bootstrap 3),客户端要求对移动视图的结构进行重大更改。

I have used Zurb Foundations Interchange in the past: http://foundation.zurb.com/docs/components/interchange.html - Which is just awesome! 我过去曾经使用过Zurb Foundations互换: http : //foundation.zurb.com/docs/components/interchange.html-太棒了!

I am wondering if anyone has used a bootstrap alternative? 我想知道是否有人使用过引导程序? Or if you have coded this before, what has been your approach? 或者,如果您之前已对此进行编码,那么您的处理方式是什么? I'm a little lost in which direction to go on this one. 我有点迷失了前进的方向。 Searching seems to yield little results. 搜索似乎收效甚微。 I will probably just do this programmatically, but like the idea of JS handling it. 我可能会以编程方式进行此操作,但是就像JS处理它的想法一样。

Many thanks 非常感谢

I had to do this for a client and I used the built in Bootstrap visible-xs , invisible-s etc. to end up with several different versions of the page depending on the screen size. 我必须为客户端执行此操作,并且使用了内置的Bootstrap visible-xsinvisible-s等,最终会根据屏幕大小显示几种不同版本的页面。 It was a bit fiddly but it didn't need any JavaScript and is easy to modify. 有点古怪,但是它不需要任何JavaScript,而且很容易修改。 It's an option at least and as you're already using Bootstrap everything you need is there. 至少这是一个选项,并且由于您已经在使用Bootstrap,因此您所需要的一切都在那里。

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

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