简体   繁体   English

语义ui使内容div可滚动但不是整个页面可滚动? (流星+反应)

[英]semantic ui make content div scrollable but not the whole page scrollable? (meteor + react)

I want to achieve something like this, that I searched up here before: 我想实现这样的事情,我之前在这里搜索过:

jsfiddle.net/psychomachine/03pfvhzs/1/ jsfiddle.net/psychomachine/03pfvhzs/1/

But the result I am getting for my application is this: 但我得到的结果是:

http://i.imgur.com/S4wbKp9.png http://i.imgur.com/S4wbKp9.png

This is the code that is being rendered: 这是正在呈现的代码:

//App.js
render() {
return <div className="main2">
  {/*HEADER (NAVIGATION + CONTEXT BAR)*/}
  <Navigation />
  {/*CONTENT*/}
  <div className="pusher">{ this.props.children }</div>
</div>;
},

Example code that goes in the content div, ie "pusher" 内容div中的示例代码,即“推送器”

<div className="ui main text container">
  <h3>Page Two</h3>
  <h3>Page Two</h3>
  <h3>Page Two</h3>
  <h3>Page Two</h3>
  <h3>Page Two</h3>
  <h3>Page Two</h3>
  <h3>Page Two</h3>
  <h3>Page Two</h3>
  <h3>Page Two</h3>
  <h3>Page Two</h3>
  <h3>Page Two</h3>
..... // This goes on for another 20 times, just to get scrolling to show
</div>

And the div for the menu bar, that is rendered at : 菜单栏的div,呈现在:

<div className="ui top attached demo inverted menu">
Rest of the code is at: http://semantic-ui.com/examples/fixed.html
If you view the page source, since it will be too cluttered to put in here

Is it not possible to do in React, due to how it renders things? React是不可能做到的,因为它呈现的是什么?

This is really bugging me, but if it can't be done, oh well, ill have to live with page inconsistencies because pages without scrolling content won't have a bar, and those that do, will have a scroll bar that will push everything to the left a little 这真是让我烦恼,但是如果它无法完成,那么,不得不忍受与页面不一致的情况,因为没有滚动内容的页面将没有条形图,而那些会这样做的页面会有一个滚动条会推动左边的一切都有点

It has nothing to do with Meteor or React, you just need to wrap your pusher in a pushable tag class, like so. 它与Meteor或React无关,你只需要将你的推动器包装在一个可推动的标签类中,就像这样。

<div class="ui bottom attached segment pushable">
  <div class="pusher">
    <div class="ui main text container">
      <h3>Page Two</h3>
      <h3>Page Two</h3>
      <h3>Page Two</h3>
      <h3>Page Two</h3>
      <h3>Page Two</h3>
      <h3>Page Two</h3>
      <h3>Page Two</h3>
      <h3>Page Two</h3>
      <h3>Page Two</h3>
      <h3>Page Two</h3>
    </div>
  </div>
 </div>

You only have to wrap it in a pushable class: 你只需要将它包装在一个可推动的类中:

 <div class="ui top attached demo inverted menu">
  <div class="pusher">
    <div class="ui main text container">
      <h3>Page Two</h3>
      <h3>Page Two</h3>
      <h3>....</h3>
    </div>
  </div>
 </div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM