用于调整下拉列表大小的Bookmarklet
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了用于调整下拉列表大小的Bookmarklet相关的知识,希望对你有一定的参考价值。
This was created as a temporary solution to the wide dropdowns that sometimes appear in OpenAir timesheets and cause horizontal scrolling. Adding this script as a bookmarklet and clicking it will resize all selects (dropdowns) on a page to 340px wide. Adapted from this bookmarklet: http://tinyurl.com/34y32r. Can be used as a starting point for other bookmarklets that will temporarily modify CSS. (Refresh will undo the changes.)
javascript:(function(){var newSS, styles='select { width: 340px; }'; if(document.createStyleSheet) { document.createStyleSheet(%22javascript:'%22+styles+%22'%22); } else { newSS=document.createElement('link'); newSS.rel='stylesheet'; newSS.href='data:text/css,'+escape(styles); document.getElementsByTagName(%22head%22)[0].appendChild(newSS); } })();
以上是关于用于调整下拉列表大小的Bookmarklet的主要内容,如果未能解决你的问题,请参考以下文章