NavBar调整电话Rails和Bootstrap

时间:2016-07-08 02:25:28

标签: html css ruby-on-rails twitter-bootstrap

我想知道如何在移动装置上折叠我的导航栏的内容,这样它就可以有一个主页链接,然后点击三个破折号下拉并显示所有其他链接。这是我的_navigation.html.erb文件:

 Dim A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z
 A = 10
 B=11
 C=12
 D=13
 E=14
 F=15
 G=16
 H=17
 I=18
 J=19
 K=20
 L=21
 M=22
 N=23
 O=24
 P=25
 Q=26
 R=27
 S=28
 T=29
 U=30
 V=31
 W=32
 X=33
 Y=34
 Z=35
 'Here i don't know how to declare the values for special characters and number
 'I need to assign, if my final result is 0,...to 9, i need 0 to 9 as result.
 'In addition to that, if my final result is 36, 37, 38, 39, 40, 41, 42, I need to show the corresponding symbols - . "" $ / + %

 Dim temp1,temp3,temp4,temp5,temp6, temp7, temp8
float temp2

temp4 = Format.Objects("Text 1").Value 'Here i input first three characters depending on user input, ex:X18
'how can i give a check option here to add the above text , for ex, i need the result called 33+1+8 to be stored
 'I have syntax called IIF(ConditionalExpr, ExprIfTrue, ExprIfFalse)

temp5= Format.Objects("Text 2").Value 'Here i input second three characters depending on user inputer, this is the characters after the space ex:VL4
  'same here too,

temp6= Format.Objects("Text 3").Value 'Here i input third 7 characters depending on user inputer, ex:0197366
  'same here too,

temp7 = 38 'this variable is for the space always this is constant 

'temp1=temp4+temp7+temp5+temp6'but this code is giving me result called X1838VL40197366, which is incorrect. I need to be like shown as below
temp1= "" 'should hold the addition of all above for ex: 33+1+8+38+31+21+4+0+1+9+7+3+6+6=168 

当我调整桌面窗口大小时,我正在尝试完成的工作。但由于某些原因,手机(720x1280像素)不会调整大小。我熟悉css中的媒体查询,我是否只需要另一个仅适用于720和更大屏幕的媒体查询?

非常感谢任何帮助!

1 个答案:

答案 0 :(得分:1)

bootstrap导航栏的默认断点是768px。我试图重现你的例子,它确实在768px以下崩溃。但是,屏幕尺寸为768像素或更高的平板电脑不会崩溃。您必须编写自己的媒体查询或更改$r->history()->get() bootstrap变量的默认值。

检查引导指南中的Changing the collapsed mobile navbar breakpoint以获取更多信息。