Documentation

jQuery Library

The Advanced Connector addon has been enriched with the jQuery library. This functionality enables to perform a lot of advanced actions, like e.g. animate the module's movements.
The example of such animation is available here (the elephant simulation) .

In simple words, the code for animating the movement is as follows:

var module1 = presenter.playerController.getModule('module1');     
$(module1.getView()).animate({    
top: '+=20'    
}, 500);

where Module ID is the module name taken from the ID field in the Properties menu. This code causes the module to smoothly move 20px down. To move the module up, it is enough to change '+=' to '-='. '500' at the end of the code is the movement's duration in milliseconds, i.e 0.5 s.
For the horizontal movement, we should simply replace 'top' with 'left'. It is also possibe to perform the horizontal and vertical movement at the same time (obliquent). The code for such an action is as follows:

var module1 = presenter.playerController.getModule('module1');    
$(module1.getView()).animate({    
top: '+=20',    
left: '-=50'    
}, 500);"

Note: Please keep in mind that after changing a page, the state resulting from e.g. animate() won't be rememebred. It is possible to set this state on PageLoaded, if needed.

jQuery enables to perform lots of other advanced actions, e.g. smoothly hide or show any module ( $("#ModuleID").fadeOut(); ).
The full list of effects which can be achieved with jQuery is available here.
It is also possible to freely change CSS styles.

Note: While using jQuery, please keep in mind that scripts written on your own may be incompatible with changes implemented in the player, therefore, all actions should be preferably performed using commands available in the addons and new features should be implemented either as new addons or reported to Learnetic with request to deploy them.