<view class="page" data-weui-theme="{{theme}}">

<view class="demo-block">
  <view class="demo-title">基础用法</view>
  <view class="demo-body">
    <mp-sticky bindscroll="onScroll">
      <button size="mini" type="primary" style="margin-left: 15px; margin-top: 0;margin-bottom: 0">基础用法</button>
    </mp-sticky>
  </view>
</view>

<view class="demo-block">
  <view class="demo-title">吸顶距离</view>
  <view class="demo-body">
    <mp-sticky offset-top="32">
      <button size="mini" type="primary" style="margin-left: 115px; background-color: #1989fa;margin-top: 0; margin-bottom: 0">吸顶距离</button>
    </mp-sticky>
  </view>
</view>

<view class="demo-block">
  <view class="demo-title">指定容器</view>
  <view class="demo-body">
    <view id="container" style="height: 250px; background-color: #E0E0E0;">
      <view style="height: 100px; background-color: #FFFF99;"></view>
      <mp-sticky container="{{container}}" offset-top="64">
        <button size="mini" type="primary" style="margin-left: 215px; background-color: #ff976a;margin-top: 0; margin-bottom: 0">指定容器</button>
      </mp-sticky>
    </view>
  </view>
</view>

<view style="height: 2000px"></view>
</view>