//index.html<div id="ball"></div>
//index.html
<div id="ball"></div>
//main.css#ball { width: 120px; height: 120px; border-radius: 120px; margin: 150px auto 0 auto;}
//main.css
#ball {
width: 120px;
height: 120px;
border-radius: 120px;
margin: 150px auto 0 auto;
}
$(document).ready(function(){ alert('ready'); });
$(document).ready(function(){ $('.ball').on('click',function(){ alert('touch'); }); });
$(document).ready(function(){ $('.ball').on('click',function(){
alert('touch');
}); });
$('.ball').on('mousedown',function(){ $(this).addClass('big');}); $('.ball').on('mouseup',function(){ $(this).removeClass('big'); });
$('.ball').on('mousedown',function(){
$(this).addClass('big');
});
$('.ball').on('mouseup',function(){ $(this).removeClass('big'); });
transition: 0.3s ease-in;
By Colin Toh