November 23, 2024

Scripts for horizontal PageScroll with PageIndicator and simultaneously vertical “Content”Scroll

/*
Scripts for horizontal PageScroll with PageIndicator
and simultaneously vertical “Content”Scroll

independent from ScreenResolution.

Example for a 4 Page Desktop from Left to Right
Page Home Page Page

“Pager” is a pined Panel with 3 Shortcuts (do nothing)
Definition should be:
First ShortcutWidth should be 3/4 of PanelWidth
Second ShortcutWidth should be 1/4 of PanelWidth
Third ShortcutWidth should be 3/4 of PanelWidth
See Picture.
If you have e.g. 5 pages the width should 4/5 and 1/5 …
The Shurtcuts could be designed as you like.
Good Solution would be:
First and Third a small colored Line at the Bottom
Second a thicker colored Line at the Bottom

hv
Above the “Pager” the pined Shortcuts “Go to specified Desktop&Postion” are placed.

 

“Content” is a pined Panel with as many VERTICAL pages as the Desktop.

Like this:
Page
Home
Page
Page

 

Thanks to +TrianguloY
I used a part of his Script Minimal Page Indicator

*/

// Script set on DesktopEvent PositionChange
var cont=LL. getDesktopByName(‘DesktopName’) ;

var width=cont.getWidth(); // DesktopWidth

var left = Math.round(cont.getBoundingBox().getLeft()/width);
var right = Math.round(cont.getBoundingBox().getRight()/width)-1;
var page = Math.round(cont.getPositionX()/width);
//With zoom –> no page selected
if(cont.getPositionScale()!=1) page=NaN;
else {
// pager is the panel with PageIndicator
var p1=cont. getItemByLabel(‘pager’). getContainer() ;
// content is the panel with VerticalContent
var p2=cont. getItemByLabel(‘content’). getContainer() ;
var pages=1;

// Calculation how many pages
if (left<0){
pages=right+1-left;
}
else {
pages=right+1;
}
// Width of the PagerPanel
var p1w=p1.getWidth();
// Height of the ContentPanel
var p2h=p2.getHeight();

// Multiplier in Pagerpanel a 1/x of the panel
var p1mult=Math.round(p1w/pages);

// New Postion vor PagerPanel
var pos1=(page*-1)*p1mult;
// New Postion vor ContentPanel
var pos2=page*p2h;

// set new Positions
p1. setPosition(pos1,0);
p2. setPosition(0, pos2);

}

 

 

// Script set on DesktopEvent SwipeUp
var cont=LL. getDesktopByName(‘DesktopName’) ;

var width=cont.getWidth();

var left = Math.round(cont.getBoundingBox().getLeft()/width);
var right = Math.round(cont.getBoundingBox().getRight()/width)-1;
var page = Math.round(cont.getPositionX()/width);

//With zoom –> no page selected
if(cont.getPositionScale()!=1) page=NaN;

else if (page<right) {

pos1=(page+1)*width;

cont. setPosition(pos1,0);

// DesktopPosition will Change > First Script will take action

}

 

// Script set on DesktopEvent SwipeDown
//
var cont=LL. getDesktopByName(‘DesktopName’) ;

var width=cont.getWidth();

var left = Math.round(cont.getBoundingBox().getLeft()/width);
var right = Math.round(cont.getBoundingBox().getRight()/width)-1;
var page = Math.round(cont.getPositionX()/width);

//With zoom –> no page selected
if(cont.getPositionScale()!=1) page=NaN;

else if(page>left) {

pos1=(page-1)*width;

cont. setPosition(pos1,0);

// DesktopPosition will Change > First Script will take action

}

 

 

 

 

6 thoughts on “Scripts for horizontal PageScroll with PageIndicator and simultaneously vertical “Content”Scroll

  1. Thomas Allor

    Attempting to add these scripts to LLX. Script works to move pages, but not panels. Any ideas?? What am I missing?

    1. gerd

      what do you want to do?

      instead of desktop you want to use this script in a panel?

      1. Thomas

        I had figured it out, Gerd. I was not applying the on desktop change script.

        Love all the work you do.
        Love the new work with kustom. I want to start working with it, but haven’t had time and am having a hard time giving up our beloved Zooper. Lol

  2. Brook

    Asking questions are actually good thing if you are not understanding something fully, however this
    paragraph presents fastidious understanding yet.

  3. Palma

    I will right away take hold of your rss feed as I can not find your email subscription link or e-newsletter service.
    Do you have any? Please allow me know so that I may just subscribe.

    Thanks.

    1. gerd

      hi. i do not have a newsletter.

Leave a Reply

Your email address will not be published.