Skip to content

Instantly share code, notes, and snippets.

View chenillen's full-sized avatar
🤩

Allen C. chenillen

🤩
View GitHub Profile
@chenillen
chenillen / cursor-finder.js
Created December 29, 2011 03:58
Find input Cursor
function getCursorPos() {
var cursorPos;
if (window.getSelection) {
var selObj = window.getSelection();
var selRange = selObj.getRangeAt(0);
cursorPos = findNode(selObj.anchorNode.parentNode.childNodes, selObj.anchorNode) + selObj.anchorOffset;
/* FIXME the following works wrong in Opera when the document is longer than 32767 chars */
alert(cursorPos);
}
else if (document.selection) {
@chenillen
chenillen / prestyle.css
Created August 21, 2012 09:09
Nice Display of Web...
html,body{
-webkit-font-smoothing:antialiased!important;
font-family:Avenir,'Helvetica Neue'!important;
}
<script>
import wepy from 'wepy'
export default class Child1 extends wepy.page {
props = {
childId: {
type: String,
default: null
}
}
<!-- parent -->
<template>
<div class="page-container">
<custom-text @custom-click="customClick" />
</div>
</template>
<script>
import wepy from '@wepy/core'