mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-13 21:34:51 +00:00
22 lines
978 B
JavaScript
Executable File
22 lines
978 B
JavaScript
Executable File
//--
|
|
//-- Zoomer animation
|
|
//--
|
|
|
|
function Zoomer(text,startElement,targetElement,unused)
|
|
{
|
|
var e = createTiddlyElement(document.body,"div",null,"zoomer");
|
|
createTiddlyElement(e,"div",null,null,text);
|
|
var winWidth = findWindowWidth();
|
|
var winHeight = findWindowHeight();
|
|
var p = [
|
|
{style: 'left', start: findPosX(startElement), end: findPosX(targetElement), template: '%0px'},
|
|
{style: 'top', start: findPosY(startElement), end: findPosY(targetElement), template: '%0px'},
|
|
{style: 'width', start: Math.min(startElement.scrollWidth,winWidth), end: Math.min(targetElement.scrollWidth,winWidth), template: '%0px', atEnd: 'auto'},
|
|
{style: 'height', start: Math.min(startElement.scrollHeight,winHeight), end: Math.min(targetElement.scrollHeight,winHeight), template: '%0px', atEnd: 'auto'},
|
|
{style: 'fontSize', start: 8, end: 24, template: '%0pt'}
|
|
];
|
|
var c = function(element,properties) {jQuery(element).remove();};
|
|
return new Morpher(e,config.animDuration,p,c);
|
|
}
|
|
|