마우스 좌클릭, 우클릭, 휠 상하 방지!입니다.
<!DOCTYPE html>
<html>
<head>
<title> TEST </title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0" maximum-scale=1.0, user-scalable=no;/>
<style>
#testt
{
background-color: #000099;
width: 120px;
height: 100px;
color: #ffff66;
float: left;
}
</style>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>
<script src="./js/jquery.blockUI.js"></script>
<script src="./js/jquery.mousewheel.js"></script>
<script type="text/javascript">
<!--
//오른쪽 마우스
$(document).bind("contextmenu", function(e){
alert("우클릭");
return false;
});
$(document).ready(function(){
//클릭 alert
$("#p_page3").click(function(){
alert("좌클릭");
});
//휠 상하 alert
$('#p_page3').mousewheel(function(event, delta, deltaX, up){
if (up > 0)
alert(' wheel UP ');
else if (up < 0)
alert( ' wheel DOWN ');
return false; // prevent default
});
});
//-->
</script>
</head>
<body>
<!-- page -->
<div data-role="page" id="p_page3">
<!-- header -->
<div data-role="header">
<h1> 지금, 시작합니다 </h1>
<a href="jquery.html" data-icon="home" data-iconpos="notext">Home</a>
<div data-role="navbar" data-iconpos="left">
<ul>
<li><a href="index.php" data-icon="grid" rel="external">index</a></li>
</ul>
</div>
</div>
<!-- content -->
<div data-role="content" border="1" id="test"></div>
<!-- footer ---------->
<div data-role="footer" data-position="fixed">
<div data-role="navbar">
<ul>
<li><a href="" data-role="button" data-icon="arrow-u">Page1</a></li>
<li><a href="" data-role="button" data-icon="star">Page2</a></li>
<li><a href="" data-icon="alert" class="ui-btn-active ui-state-persis">Page3</a></li><!--활성화-->
<li><a href="">Page4</a></li>
<li><a href="" data-icon="info" rel="external">Page5</a></li>
</ul>
</div>
</div>
</div>
</body>
</html>
클릭 :
휠 :
'Web > jQuery' 카테고리의 다른 글
jquery ajax 빽단사용, on click (0) | 2014.02.24 |
---|