Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

86 lines (63 sloc) 1.565 kB
<html>
<head>
<title>myQuery experiment</title>
<style>
#container{
width:300px;
height:300px;
border:1px solid black;
}
#sidebar{
color:blue;
background:red;
}
.item{
color:blue;
}
</style>
</head>
<body>
<div id="container">
myQuery
</div>
<div class="item">a</div>
<div class="item">b</div>
<div class="item">c</div>
<div id="sidebar" data-role="side">
Testing testing
</div>
<div id="nodetest">hello!</div>
<script type="text/javascript" src="myQuery.js"></script>
<script type="text/javascript">
/////Usage///
//Ready..
myQuery('document').ready(function(){
console.log('something loaded on document ready');
//Setter tests
myQuery('#container')
.css('color','red')
.attr('alt', 'myContainer')
.attr('title','testing')
.bind('click', function(){
console.log('magic');
})
.css('background-color','green')
.bind('mouseover', function(){
console.log('hover');
})
.css('width','400px');
myQuery('.item').css('color','green');
//Getter tests
var q = (myQuery('#sidebar'));
console.log('value of the sidebar color is:' + q.css('color'));
console.log('value of the sidebar id is:' + q.attr('id'));
console.log('value of the sidebar data-role is:' + q.attr('data-role'));
var domNode = document.getElementById('nodetest');
myQuery(domNode).css('color','blue');
//
var s = myQuery('.item').last();//.css('color','pink');
console.log(s);
});
</script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.