소개를 해볼까하네요.
jQuery의 click 이벤트 toggle를 적용 해놓았습니다.
<div class="moving-zone">
<div class="popup">
<div class="popup-content">
<div class="popup-text">
I'm a new kind of <b>popup</b>.<br />
Move your <b>mouse</b> around !
</div>
</div>
</div>
</div>
<div>
<button class="btnpopup">POPUP Show/Hide</button>
</div>
var moveForce = 30; // max popup movement in pixels
var rotateForce = 20; // max popup rotation in deg
$(document).mousemove(function(e) {
var docX = $(document).width();
var docY = $(document).height();
var moveX = (e.pageX - docX/2) / (docX/2) * -moveForce;
var moveY = (e.pageY - docY/2) / (docY/2) * -moveForce;
var rotateY = (e.pageX / docX * rotateForce*2) - rotateForce;
var rotateX = -((e.pageY / docY * rotateForce*2) - rotateForce);
$('.popup')
.css('left', moveX+'px')
.css('top', moveY+'px')
.css('transform', 'rotateX('+rotateX+'deg) rotateY('+rotateY+'deg)');
});
$(document).ready(function() {
$('.btnpopup').click(function() {
$('.popup').slideToggle("fast");
});
});