https://github.com/minooo/jquery-diary
我的jquery练习日记
https://github.com/minooo/jquery-diary
Last synced: 6 months ago
JSON representation
我的jquery练习日记
- Host: GitHub
- URL: https://github.com/minooo/jquery-diary
- Owner: minooo
- Created: 2014-12-10T08:09:31.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-07-09T05:18:07.000Z (about 11 years ago)
- Last Synced: 2025-10-31T07:38:26.392Z (9 months ago)
- Language: HTML
- Size: 555 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 软件安装相关问题总结
#####window默认的编码是GBK,如何转为utf-8?
运行cmd,输入chcp 65001 运行即可!
chcp 65001 #换成utf-8代码页
chcp 936 #换成默认的gbk
一般默认为gbk,若要修改成 utf-8,则需要:
1、cmd窗口输入:
chcp 65001
2、修改cmd属性:
选择字体为“Lucida Console”
#####css3水平垂直居中代码
```javascript
.center {
width: 300px;
height: 200px;
padding: 10px;
border: 1px solid #ccc;
margin: 20px auto;
display: -webkit-box;
-webkit-box-orient: horizontal;
-webkit-box-pack: center;
-webkit-box-align: center;
display: -moz-box;
-moz-box-orient: horizontal;
-moz-box-pack: center;
-moz-box-align: center;
display: -o-box;
-o-box-orient: horizontal;
-o-box-pack: center;
-o-box-align: center;
display: -ms-box;
-ms-box-orient: horizontal;
-ms-box-pack: center;
-ms-box-align: center;
display: box;
box-orient: horizontal;
box-pack: center;
box-align: center;
}
.center img,
.text {
border: 1px solid #dedede;
padding: 2px;
}
```
#####jquery水平垂直居中代码
```javascript
$(window).resize(function(){
$('.className').css({
position:'absolute',
left: ($(window).width() - $('.className').outerWidth())/2,
top: ($(window).height() - $('.className').outerHeight())/2 + $(document).scrollTop()
});
});
//初始化函数
$(window).resize();
```
##### 自适应的图片如何等比例缩放?
首先,图片要自带 width=300 height=450 属性。
然后jquery代码 $('.my-img').height($('.my-img').width/3*4);即可
##### 安装ruby,以及sass简要步骤
安装ruby界面,怒选后两项,跟着步骤走,完事输入ruby -v检测是否安装成功;
然后输入以下代码开始安装sass,
gem sources --remove https://rubygems.org/
gem source -a https://ruby.taobao.org
gem install sass
然后就成功了!
另外注意就是-路径一定要是英文的!!!
##### webstorm 关于scss输出css和map文件到css文件夹中的方法
Arguments:
--no-cache --update --sourcemap --watch $FileName$:$ProjectFileDir$\css\$FileNameWithoutExtension$.css
如果要输出的css压缩,可以这样设置
--no-cache --update --style compressed --sourcemap --watch $FileName$:$ProjectFileDir$\css\$FileNameWithoutExtension$.css
Working directory:
$FileDir$
Output paths to refresh:
$FileNameWithoutExtension$.css
##### zepto判断对象是否隐藏
if ( mm.css("display") != "none"&& mm.css("visibility") != "hidden" ) { ------ }