当我在特定表上滚动时,是否可以找出我在哪个表上?

时间:2018-12-07 20:20:00

标签: html reactjs html-table

我建立了一个React网站,我在其中放置了7个带有滚动条的表格。我想做的是,当我在下面的表格滚动条上滚动时,将下面的图像从另一种颜色转换为一天。这是带有表格的我的网站的图像:

enter image description here

我的代码:

<permission-group android:name="com.example.android.mybroadcastreceiver.my_permissions"
    android:label="my permissions group"/>
<permission android:name="com.example.android.mybroadcastreceiver.my_permissions.MY_PERMISSION"
    android:permissionGroup="com.example.android.mybroadcastreceiver.my_permissions"
    android:label="my permission"/>

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <receiver android:name=".MyBroadcastReceiver"
        android:permission="com.example.android.mybroadcastreceiver.my_permissions.MY_PERMISSION">
        <intent-filter>
            <action android:name="com.example.android.projekt1.notification">
            </action>
        </intent-filter>
    </receiver>
    <service android:name="MyService" />
</application>

1 个答案:

答案 0 :(得分:1)

您可以为每个表/标题对设置scroll event的侦听器。

在事件处理程序中,您将根据table.scrollY的值设置标题的样式,其中tabletable-scroll元素之一。