Display indicators for touch events. Particularly useful for video captures.
-
Include jQuery:
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.2.1/jquery.min.js"></script>
-
Include plugin's code:
<script src="dist/jquery.touchcircle.min.js"></script>
-
Call the plugin:
$("body").touchCircle({ radius: 40 });
<html>
<head>
<title>TouchCircle Test</title>
</head>
<body>
...
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.2.1/jquery.min.js"></script>
<script src="dist/jquery.touchcircle.js"></script>
<script type="text/javascript">
$( function() { $( "body" ).touchCircle() } )
</script>
</body>
</html>
$( "body" ).touchCircle( {
enabled: true, // if false, will disable everything
radius: 50, // size of the touch circle
zindex: 10, // z-index of the overlay
createTouchDiv: function( me ) { // create your own custom touch div
var touchPointDiv = $( "<div class='touchcircle_point'></div>" );
touchPointDiv.css( "width", me.settings.radius * 2 );
touchPointDiv.css( "height", me.settings.radius * 2 );
touchPointDiv.css( "border", "4px solid black" );
touchPointDiv.css( "background", "#999" );
touchPointDiv.css( "opacity", "0.5" );
touchPointDiv.css( "border-radius", "50%" );
// note that the plugin will also set position:absolute
return touchPointDiv;
}
})
Quick Demo