记录一个很巧妙的js折叠

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" />
<title>秋空动漫社</title>
<style>
body{margin:0;padding:0;background:#000 url(index.jpg) no-repeat fixed center/cover;}
nav{position:fixed;bottom:0;width:100%;background:rgba(0,0,0,0.6);font-size:0;}
nav a{display:inline-block;padding:6px 0;width:25%;color:#CCC;font-family:Microsoft Yahei;font-weight:bold;font-size:14px;text-decoration:none;text-align:center;vertical-align:bottom;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
</style>
</head>
<body>
<nav>
<a>秋空动漫社 5<sup>th</sup></a>
<a href="http://loli.ee" target="_blank">&#10022;肥宅之家</a>
<a href="http://loli.vip" target="_blank">&#10022;萝莉图鉴</a>
<a href="javascript:;" onclick="var link=document.getElementById('link').style;link.display=(link.display=='none')?'':'none';">&#9660;友情链接</a>
<span id="link" style="display:none;">
<a href="http://52astro.com" target="_blank">Astro</a>
<a href="http://mrz.name" target="_blank">Mr.Z</a>
<a href="http://gerleychan.lofter.com" target="_blank">Gerley</a>
<a href="http://anohana.org" target="_blank">脑浆物语</a>
<a href="http://youthlin.com" target="_blank">霖博客</a>
<a href="http://labofjet.com" target="_blank">Jet</a>
<a href="http://biji.io" target="_blank">设计笔记</a>
<a href="http://yefz.net" target="_blank">Yefz</a>
<a href="http://bestcherish.com" target="_blank">灰常记忆</a>
<a href="http://ilcl.cc" target="_blank">乐亦人生</a>
<a href="http://dijianwu.cn" target="_blank">拔剑舞</a>
<a href="http://yptk.cn" target="_blank">云破天开</a>
<a href="http://qiuri.org" target="_blank">秋日</a>
<a href="http://mouto.org" target="_blank">卜卜口</a>
<a href="http://nimaboke.com" target="_blank">尼玛博客</a>
<a href="http://yoooo.co" target="_blank">Yoooo</a>
<a href="http://www.xmoe.me" target="_blank">X小窝</a>
</span>
</nav>
</body>
</html>

不要说我水平低- -我没怎么学过js2333,直接上jquery的

用过几次js的三目运算,今天才想到display可以不设置的- –

2333

说点什么

您将是第一位评论人!

avatar
  Subscribe  
提醒