-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
6 lines (6 loc) · 5.01 KB
/
index.html
1
2
3
4
5
6
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="X-UA-Compatible" content="IE=edge"><title> basecss.net</title><meta name="description" content="A Blog Powered By Hexo"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/css/apollo.css"><link rel="stylesheet" href="http://fonts.useso.com/css?family=Source+Sans+Pro:400,600" type="text/css"></head><body><header><a href="/" class="logo-link"><img src="/logo.jpg"></a><ul class="nav nav-list"><li class="nav-list-item"><a href="/" target="_self" class="nav-list-link">首页</a></li><li class="nav-list-item"><a href="/archives/" target="_self" class="nav-list-link">归档</a></li><li class="nav-list-item"><a href="https://github.com/basecss" target="_blank" class="nav-list-link">GITHUB</a></li><li class="nav-list-item"><a href="/atom.xml" target="_self" class="nav-list-link">订阅</a></li><li class="nav-list-item"><a href="/about/" target="_self" class="nav-list-link">关于</a></li></ul></header><section class="container"><ul class="home post-list"><li class="post-list-item"><article class="post-block"><h2 class="post-title"><a href="/2014/03/27/code-learning/" class="post-title-link">JavaScript 位运算学习</a></h2><div class="post-time">Mar 27, 2014</div><div class="post-content"><p>这几天粗略的阅读了一下 <a href="http://angularjs.org/">AngularJS</a> 的源码,在这个过程中发现有这么两段代码挺有意思的:</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> manualLowercase = <span class="function"><span class="keyword">function</span> (<span class="params">s</span>) </span>{</span><br><span class="line"> <span class="keyword">return</span> isString(s) ? s.replace(<span class="regexp">/[A-Z]/g</span>, <span class="function"><span class="keyword">function</span>(<span class="params">ch</span>) </span>{</span><br><span class="line"> <span class="keyword">return</span> <span class="built_in">String</span>.fromCharCode(ch.charCodeAt(<span class="number">0</span>) | <span class="number">32</span>)</span><br><span class="line"> }) : s</span><br><span class="line">}</span><br><span class="line"><span class="keyword">var</span> manualUppercase = <span class="function"><span class="keyword">function</span> (<span class="params">s</span>) </span>{</span><br><span class="line"> <span class="keyword">return</span> isString(s) ? s.replace(<span class="regexp">/[a-z]/g</span>, <span class="function"><span class="keyword">function</span>(<span class="params">ch</span>) </span>{</span><br><span class="line"> <span class="keyword">return</span> <span class="built_in">String</span>.fromCharCode(ch.charCodeAt(<span class="number">0</span>) & ~<span class="number">32</span>)</span><br><span class="line"> }) : s</span><br><span class="line">}</span><br></pre></td></tr></table></figure>
<blockquote>
<p>这两段代码用来处理字母大小写转换,由于某些国家(土耳其)使用 <code>toLowerCase()</code> 和 <code>toUpperCase()</code> 不能正确的转换字母大小写,因而需要手动的处理。</p>
</blockquote></div><a href="/2014/03/27/code-learning/" class="read-more">...继续阅读</a></article></li><li class="post-list-item"><article class="post-block"><h2 class="post-title"><a href="/2013/12/27/classlist/" class="post-title-link">classList 笔记</a></h2><div class="post-time">Dec 27, 2013</div><div class="post-content"><p>HTML5 中新增了一个 <code>classList</code> API,顾命思议使用它能够获取一个 html 元素的 class 列表,并且能够使用 JavaScript 来管理这个 class 列表。比如:增删改。</p>
<p>使用 <code>classList</code> 非常方便,在此之前操作元素的 class 可谓相当头疼。</p></div><a href="/2013/12/27/classlist/" class="read-more">...继续阅读</a></article></li><li class="post-list-item"><article class="post-block"><h2 class="post-title"><a href="/2013/07/09/opacity/" class="post-title-link">CSS半透明总结</a></h2><div class="post-time">Jul 9, 2013</div><div class="post-content"><h2 id="opacity-属性"><a href="#opacity-属性" class="headerlink" title="opacity 属性"></a>opacity 属性</h2><p>CSS 中的 <code>opacity</code> 属性用于给元素指定一个 0 (全透明) 至1 (不透明) 的透明度值,但是这个值会应用到覆盖在背景之上的元素。</p></div><a href="/2013/07/09/opacity/" class="read-more">...继续阅读</a></article></li></ul></section><footer><div class="paginator"></div><div class="copyright"><p>© 2015 - 2016 <a href="http://www.basecss.net">basecss</a>, unless otherwise noted.</p></div></footer></body></html>