Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

function encodeUrl(url, params) {
let paramStr = ''
for(let key in params) {
paramStr+=key+'='+params[key]+'&'
}
return url+'?'+paramStr.slice(0, paramStr.length-1)
}
function jsonp(url, params, cb) {
url = encodeUrl(url, params)
/* date */
input[type="date"]::-webkit-clear-button {
-webkit-appearance: none;
display: none;
}
input[type="date"]::-webkit-inner-spin-button {
-webkit-appearance: none;
display: none;
}
@kmokidd
kmokidd / Super-Media-Query.css
Created March 25, 2016 02:41
iPhone family. Main Android. Wechat and QQ's X5
// --------------------------MQ--------------------------//
/* iPhone4 iPhone5/5s
* 超级低端 Android
*/
@media (max-device-width: 320px){
}
/* Especially for iPhone4 */
@media (max-device-width: 320px) and (max-device-height: 480px) and (-webkit-min-device-pixel-ratio: 2){
}
// prevent ios touchmove will cause page scolller
window.addEventListener('touchmove',function(ev){
ev.preventDefault();
});
@kmokidd
kmokidd / flex
Last active July 9, 2019 15:23 — forked from HeGanjie/android-flex.css
Adapt android 2.1+ WebView, thanks https://github.com/stevenbenisek/compass-flexbox
/* display:flex; */
.flex { display: -webkit-box; display: -moz-box; display: -ms-flexbox; display: -webkit-flex; display: flex; }
/* for Android 4.3- */
.flex > * {display: block;}
/* row reverse */
.flex.flex--reverse { -webkit-box-orient: horizontal; -moz-box-orient: horizontal; -webkit-box-direction: reverse; -moz-box-direction: reverse; -webkit-flex-direction: row-reverse; -ms-flex-direction: row-reverse; flex-direction: row-reverse; }
/* column */
.flex--clo { -webkit-box-orient: vertical; -moz-box-orient: vertical; -webkit-box-direction: normal; -moz-box-direction: normal; -webkit-flex-direction: column; -ms-flex-direction: column; flex-direction: column; }
/* column reverse*/
.flex--col.flex--reverse { -webkit-box-orient: vertical; -moz-box-orient: vertical; -webkit-box-direction: reverse; -moz-box-direction: reverse; -webkit-flex-direction: column-reverse; -ms-flex-direction: column-reverse; flex-direction: column-reverse; }
@media (orientaion: landscape){
body{
transform: rotate(-90deg);
}
}
/* opacity is .8 */
.op{
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=80);
filter: alpha(opacity=80);
opacity: 0.8\0;
}
html{
-webkit-touch-callout: none;
touch-callout: none;
-webkit-user-select: none;
user-select: none;
}
@kmokidd
kmokidd / text overflow
Last active March 9, 2017 09:25
处理文本截断
/* method 1 */
.parent-wrapper{
width: 100px; /*set by yourself*/
line-height: 1.05;
overflow: hidden;
text-overflow:ellipsis;
white-space:nowrap;
}
/* method 2 */