Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"development": {
"component/aurora-tip": "*",
"component/jquery": "*"
"component/event": "*"
},
"scripts": [
"index.js",
Expand Down
30 changes: 17 additions & 13 deletions test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@
margin: 80px;
width: 80%;
}
.tip {
background-color: black;
}
</style>
</head>
<body>
Expand All @@ -67,29 +64,36 @@
<a href="#" id="big">Big</a>
</div>
<script>
var o = require('jquery');
var Tip = require('tip');
var q = require('query');
var events = require('event');

'#bottom,#left,#right,#top,#bottom-right,#bottom-left,#top-right,#top-left'.split(',').forEach(function(id){
var el = q(id),
tip = new Tip(el.textContent);
tip.position(el.textContent.toLowerCase().split('-').join(' '));

o('#bottom,#left,#right,#top,#bottom-right,#bottom-left,#top-right,#top-left').each(function(i, el){
var tip = new Tip(o(el).text());
tip.position(o(el).text().toLowerCase().split('-').join(' '));
o(el).hover(function(){
events.bind(el, 'mouseenter', function(){
tip.show(el);
}, function(){
});
events.bind(el, 'mouseleave', function(){
tip.hide(200);
})
});
})

var maru = new Tip('<img src="http://www.lifelounge.com.au/resources/IMGRELATED/maru-magic-show-catbag-youtube-cat-adventure.jpg" width="200" height="100" />');
maru.show('#maru');

var tip = new Tip('<input type="search" placeholder="Search" />');
tip.position('top');
o('#markup').hover(function(){

var el = q('#markup');
events.bind(el, 'mouseenter', function(){
tip.show('#markup');
}, function(){
});
events.bind(el, 'mouseleave', function(){
tip.hide(200);
})
});

var auto = new Tip('Some tip contents');
auto.position('bottom');
Expand Down