用小屏幕折叠侧边栏和手风琴

时间:2017-01-02 14:12:25

标签: html css twitter-bootstrap responsive-design

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

的效果

但我不知道如何使用导航标签更改内容。我在stackoverflow http://www.bootply.com/88026上找到了这个例子。

如何仅在小屏幕上对手风琴进行转换?

非常感谢。

1 个答案:

答案 0 :(得分:0)

您可以使用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中添加内容
  

如果这对您有用,请将此答案标记为正确的答案..:)

相关问题