div#content div.view-display-id-page_4 div.views-row {
float: left; // floats left so they fit the space
margin: 0 20px 20px 0; // gives them breathing room
position: relative;
width: 150px; // or whatever you need for your content
height: 250px; // or whatever you need, prevents 'stacking' elements
}
它以浏览器宽度流动,没有额外的开销。
我已经用这个出色的jQuery插件解决了:
http://welcome.totheinter.net/columnizer-jquery-jquery-plugin/
您可以使用Javescript尽可能多地重写DOM。您几乎可以使用JavaScript做任何事情。但是,检测浏览器可能有些棘手,但这与Drupal或视图模块无关。
我自己只是在研究这个 - 我相信这做了您想要的:
Http://drupalcontrib.org/api/function/cck_gallery_preprocess_node/6
nevermind,我看到您想通过JS进行,而不是Php。
I使用Bootstrap,因此易于添加响应页面宽度Col-12 Col-12-6 Col-LG-4的类,将显示一个用于小屏幕的单列,中等尺寸的2列和3列的桌面列。您应该能够使用自己的课程使用JS进行类似的操作。