--- tags: jQuery --- ###### tags: `jQuery` # 表格根據響應式出現卷軸提示 ```jquery $(window).on('resize', function () { $('.table-responsive').each(function () { var tableWidth = $(this).find('table').width(), tableOuterWidth = $(this).width(); if (tableWidth > tableOuterWidth) { $(this).addClass('scroller'); } else { $(this).removeClass('scroller'); } }); }).trigger('resize'); ``` ```scss .b-product-detailed__wrap .scroller { background: url(../images/icons/scroll_hint.svg) top right no-repeat; background-size: 88px; padding-top: 35px; } ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up