O
O
Olga Zhizhka2015-08-26 12:38:00
JavaScript
Olga Zhizhka, 2015-08-26 12:38:00

How to make an animation of a constellation that moves with the mouse?

Please help me figure out how to make an animation for canvas of the constellation type, which moves along with the mouse around the site, like here - mahno.com.ua/en . Maybe there are ready-made scripts similar

Thanks in advance for the answers

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey, 2015-08-27
@AlekseyChuyan

jQuery: Get cursor coordinates, set block element coordinates to cursor coordinates +/- offset by desired distance. Bind execution to an event - cursor movement
$('#BlockElementId').mousemove( function(){
//set element coordinates
} )

O
Olga Zhizhka, 2015-08-28
@Helga_Zhizhka

Thanks a lot for the replies! On codePen I found a similar implementation of such animation -
codepen.io/jkiss/pen/OVEeqK

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question