记录学习JavaScript的珍贵点滴。
- 用于关键词高亮,angularJS的filter:
App.filter('ex.highlight', function () { return function (text_org, keyword) { if (keyword){ var regex = eval('/(' + keyword + ')/gi'); return text_org.replace(regex, "<span class='highlight'>$1</span>"); } else { return text_org; } };});
背景自适应 http://css-tricks.com/perfect-full-page-background-image/ |