User Tools

Site Tools


script_simultaneous_scrolling

====== About the script ====== * Purpose : Make two or more containers scroll simultaneous * Author : F43nd1r * Current Version : 1.0 * Link : ====== Changelog ====== * Version 1.0 (7/6/2015): initial release in wiki ====== How to use the script ==== * Set the script in the position changed event of all containers which should scroll together. * Scroll each of these containers at least once to trigger the script ====== Issues and hints ====== * //please report all bugs in the g+ community// ====== Script code ====== <sxh javascript;> if(typeof loopPreventCounter=="undefined") loopPreventCounter=0; if(loopPreventCounter>0){ loopPreventCounter--; return; } var script=LL.getCurrentScript(); var c=LL.getEvent().getContainer(); var tag=script.getTag(); if(tag==null||tag=="")tag="[]"; var a=JSON.parse(tag); var id=c.getId(); if(a.indexOf(id)==-1)a.push(id); var x=c.getPositionX(); var y=c.getPositionY(); for(var i=0;i<a.length;i++){ if(a[i]==id)continue; var cont=LL.getContainerById(a[i]); if(cont!=null){ loopPreventCounter++; cont.setPosition(x,y, 1,false); } else { a.splice(i,1); i--; } } script.setTag(JSON.stringify(a)); </sxh>

script_simultaneous_scrolling.txt · Last modified: 2016/06/28 12:18 by f43nd1r