私はこのスニペットをブラウザで開いてブートストラップリオーダーは
<div class="container">
<div class="row">
<div id="left" class="col-xs-5 col-sm-5">
How are you?
</div>
<div id="right" class="col-xs-7 col-sm-7">
Thanks, I'm fine.
</div>
</div>
</div>
の場合を持って考えると、それは
How are you? Thanks, I'm fine.
を表示する必要がありますし、右側に新しい行を破る左へ右と左から右へ768pxより上記のスニペットを得たい
Thanks, I'm fine.
How are you?
私は次のjavascriptを使用して、いつviewpoブラウザの幅は< = 767です。
/*
@Leo
Obtained from:
http://stackoverflow.com/questions/1766861/find-the-exact-height-and-width-of-the-viewport-in-a-cross-browser-way-no-proto
*/
var getviewport = function(){
var viewPortWidth;
var viewPortHeight;
// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
if (typeof window.innerWidth != 'undefined') {
viewPortWidth = window.innerWidth,
viewPortHeight = window.innerHeight
}
// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
else if (typeof document.documentElement != 'undefined'
&& typeof document.documentElement.clientWidth !=
'undefined' && document.documentElement.clientWidth != 0) {
viewPortWidth = document.documentElement.clientWidth,
viewPortHeight = document.documentElement.clientHeight
}
// older versions of IE
else {
viewPortWidth = document.getElementsByTagName('body')[0].clientWidth,
viewPortHeight = document.getElementsByTagName('body')[0].clientHeight
}
return [viewPortWidth, viewPortHeight];
};
var adjust = function(){
var width = getviewport()[0];
if(width<=767){
$("#left").addClass("col-xs-push-7");
$("#right").addClass("col-xs-pull-5");
}
else{
$("#left").removeClass("col-xs-push-7");
$("#right").removeClass("col-xs-pull-5"); }
};
adjust();
$(window).resize(adjust);
したがって、ビューポートの幅が< = 767のとき。私は、「どのようにしている。おかげで、私は大丈夫だよ?」私は上記の順序付けを達成することができました*対応XS-プッシュ*およびxs-プルを追加することによって計算書に
"How are you? Thanks, I'm fine." to "Thanks, I'm fine. How are you?
を注文してみてください
はしかし、私は何かがさらに誰かが助けを提供することができれば、私は喜んでいるでしょう
Thanks, I'm fine.
How are you?
に声明を破るために行うことができます感じています。
ありがとうございます。私はそれがこのように振る舞いたいと思う。例えば、1-2が左側と右側と同じ列にインラインであるならば、私は最初に来る2つの権利を持ち、1つ目の行新しい行と独自の行を占めています。 1 - 2前に2 \ n 1になります。 –
これはこのソリューションの機能です。「スニペットを展開」をクリックして「実行」してウィンドウサイズを変更すると表示されます。 – henry
ほとんど動作しています。私は "スニペットを展開"するときこのように動作し、1 - 2の代わりに2 - 1を表示させてから、ブラウザを768px以下に減らして1 \ n 2にしてください。 –