rubylouvre / avalon.pilotui Goto Github PK
View Code? Open in Web Editor NEW基于avalon的Pilot UI库
基于avalon的Pilot UI库
难点是要得@距离文本区的左边与上边的距离。
<!DOCTYPE html>
<html>
<head>
<title>@提示组件</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<script src="jquery.js">
</script>
<script>
$(function() {
var div
$("textarea").on("input", function() {
var self = $(this)
if (/@/.test(this.value)) {
if (!div) {
div = $("<div/>").appendTo("body").css({
width: self.width(),
height: self.height(),
border: "1px solid red"
}).text(self.val())
}
}
})
})
</script>
</head>
<body>
<textarea>
</textarea>
</body>
</html>
<!DOCTYPE html>
<html class="p-index">
<head>
<meta charset="utf-8" />
<title>透明穿透</title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="author" content="" />
<script src="avalon.js">
</script>
<style>
html,body{_height:100%;margin:0;padding:0;}
#aaa{
background: red;
width:180px;
height:180px;
padding:2px;
border:5px solid green;
}
#bbb{
width:220px;
height:220px;
position: absolute;/*或fixed, relative*/
top:0px;
left:0px;
border:1px solid black;
filter:alpha(opacity=50);/*透明或半透明 ,IE9还可以用opacity, 还可以用progid:DXImageTransform.Microsoft.gradient*/
pointer-events: none;
}
</style>
<script>
avalon.define("test", function(vm) {
vm.click = function() {
alert(this.id)
}
})
</script>
</head>
<body>
<div ms-controller="test" style="position: relative;padding:50px;">
<div id="aaa" ms-click="click">
<p>这是底层的DIV</P>
<p>点击它上面的文本或图片或表单控件或元素边框会发生穿透</p>
<input>
</div>
<div id="bbb">这是绝对定位的DIV,浮在div#aaa的上方
</div>
</div>
</body>
</html>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.