Created
November 17, 2016 16:07
-
-
Save clytras/98e6a6fb9a7adf008f55ec11fc783229 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addCircle(options) { | |
$('#clickAreas').append( | |
$('<div/>', { | |
id: options.hotspotid, | |
title: options.title, | |
'class': 'circle', | |
css: { | |
top: options.top+'px', | |
left: options.left+'px', | |
width: options.width+'px', | |
height: options.height+'px' | |
} | |
}).tooltip({ | |
track:true, | |
tooltipClass: 'circle-tooltip' | |
}).on('click', function() { | |
$('.circle.do-anim > *').removeClass('anim'); | |
$('.circle.do-anim').removeClass('do-anim'); | |
$(this).addClass('do-anim'); | |
$('.back-circle-1, .back-circle-2', this).addClass('anim'); | |
changeStyle($(this).prop('id')); | |
}).append( | |
$('<div class="back-circle-1"/>'), | |
$('<div class="back-circle-2"/>'), | |
$('<div class="front-circle"/>') | |
) | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment