html - 小屏幕折叠侧边栏和 Accordion

标签 html css twitter-bootstrap responsive-design

我正在尝试重现此模板页面的效果 https://livedemo00.template-help.com/wt_58977/services.html#undefined1

但我不知道如何更改内容,就像带有导航选项卡的面板一样。我在 stackoverflow 上找到了这个例子 http://www.bootply.com/88026 .

如何在 Accordion 上仅针对小屏幕进行转换?

非常感谢。

最佳答案

您可以使用 JavaScript 轻松完成此操作。

function clickedLink(linkID){
  // ------------------------------------------------------ hide all
  document.getElementById('home').style.display = 'none';
  document.getElementById('link1').style.display = 'none';
  document.getElementById('link2').style.display = 'none';
  document.getElementById('link3').style.display = 'none';
  // ------------------------------------------------------ show active
  document.getElementById(linkID).style.display = '';
}

这是一个可行的解决方案:http://www.bootply.com/4EsSTTHzGs

//编辑: 现在我明白你想做什么 :) 你可以同时构建它们并使用 hidden-xx (xx: xs, sm, md, lg)

看看这个:http://www.bootply.com/HIFkqIQgI3

如果您不想两次编写相同的内容,您可以使用类似于 <?php include 'folderx/contentx.html'; ?> 的内容将内容包含在 php 中

If this is working for you, mark this Answer as the right Answer.. :)

关于html - 小屏幕折叠侧边栏和 Accordion ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41428428/

相关文章:

javascript - 使用 javascript 的一行的 bresenham 算法

css - 只为某些元素覆盖 CSS 选择器 - Sencha

javascript - jQuery Slider 在 IE 中不工作

css - Twitter Bootstrap 删除跨度的边距

jquery - bootstrap 3 侧边栏停用子项

html - 如何从 TembeddedWB 内的资源加载图像

html - 使用 float 元素垂直对齐内容+响应式布局

mysql查询中的php循环

python - 在 Flask 应用程序的不同选项卡下加载不同页面

javascript - 如何让子 div 在可调整大小的 Bootstrap 面板中占据父 div 的全部空间?