Vector's Blog


  • 首页

  • 归档

  • 标签

搭建Hexo+Github Pages博客

发表于 2016-12-09   |     |   阅读次数

注册 Github 账号

Github官网

生成 Github Pages

假设,你注册github时的username为hello,

邮箱为xxx@123.com。

点击 New repository 即新建仓库,

Repository name 那里就得填写 hello.github.io,

然后点击Create repository。

再点击右边的Settings,把页面拉到下面,

你会看到一个Lauch automatic page generator 按钮,点击它。

进入另一个页面后,直接拉到下面,点击右下角的Continue to layouts按钮。

页面跳转后,随便选择一个主题,然后点击Publish Page按钮。

Github Pages完成了!

现在你可以在浏览器输入https://hello.github.io预览到Github Pages了。

阅读全文 »

code clip

发表于 2016-12-08   |     |   阅读次数

Code Clip

根据屏幕大小更改样式

jQuery

1
2
3
4
5
if (window.screen.width < 1920||$(window).width()<1920) {
$(document.body).css({
"overflow-y": "auto"
});
};

根据屏幕大小以及浏览器更改样式

html

1
2
3
4
5
6
7
8
9
10
<!--[if IE 8]>
<script>
$(document).ready(function () {
window.onresize = function () { location = location };
if ($(window).width() < 1400) {
$(".spanFont").css("font-size", "16px");
} else {}
})
</script>
<![endif]-->

回车登录

html

1
<body onkeydown="keyLogin(et)">

jQuery

1
2
3
4
function keyLogin(et){
if (et.keyCode==13||et.which==13)
document.getElementById("login-btn").click();
}

禁止右键

jQuery

1
2
3
4
5
$(document).ready(function(){
$(document).bind("contextmenu",function(e){
return false;
});
});

页面样式切换

jQuery

1
2
3
4
5
$(document).ready(function() {
$("a.Styleswitcher").click(function() {
$('link[rel=stylesheet]').attr('href' , $(this).attr('rel'));
});
});

html

1
2
3
4
5
6
<head>
<link rel=stylesheet type=text/css href="default.css">
</head>
<a class="Styleswitcher" href="#" rel="default.css">Default Theme</a>
<a class="Styleswitcher" href="#" rel="red.css">Red Theme</a>
<a class="Styleswitcher" href="#" rel="blue.css">Blue Theme</a>

hack

发表于 2016-12-08   |     |   阅读次数

常用的CSS hack方式

方式一 条件注释法

只在IE下生效

1
2
3
<!--[if IE]>
这段文字只在IE浏览器显示
<![endif]-->

只在IE6下生效

1
2
3
<!--[if IE 6]>
这段文字只在IE6浏览器显示
<![endif]-->

只在IE6以上版本生效

1
2
3
<!--[if gte IE 6]>
这段文字只在IE6以上(包括)版本IE浏览器显示
<![endif]-->

只在IE8上不生效

1
2
3
<!--[if ! IE 8]>
这段文字在非IE8浏览器显示
<![endif]-->

非IE浏览器生效

1
2
3
<!--[if !IE]>
这段文字只在非IE浏览器显示
<![endif]-->

阅读全文 »
1…678
林某亮

林某亮

满地都是六便士
他却抬头看见了月亮

22 日志
3 标签
GitHub Weibo
© 2018 林某亮
由 Hexo 强力驱动
主题 - NexT.Pisces