Skip to main content
saidivyam
June 20, 2022
Solved

Auto Scrolling image Gallery

  • June 20, 2022
  • 24 replies
  • 0 views

Hi All,

          I have a requirement that to display  gallery of  images that needs to be automatically scrolled  .

Is there any possibilities for this requirement?

         

Best answer by richardm900458

@stewart:took some brain cells but is working more or less.


a!localVariables(
  local!timestamp:now(),
  local!timedifferenceInSecond: a!refreshVariable(
    value: sum(second(now()-local!timestamp),minute(now()-local!timestamp)*60),
    refreshInterval: 0.5
  ),
  local!timedifferenceFactor:a!refreshVariable(
    value: round(local!timedifferenceInSecond/30,0),
    refreshInterval: 0.5
  ),
 
  local!pictures:{
    cons!SR_CARD3_223425722,
    cons!SR_FREE_BLEEDING_CC0_PIXABAY_MYRIAMS_FOTOS_191216
  },
  local!indexInterval:a!refreshVariable(
    value: mod(local!timedifferenceFactor,count(local!pictures)),
    refreshInterval: 0.5
  ),
  local!index: 1+local!indexInterval,
  local!seletedPicture:index(local!pictures,local!index,cons!SR_CARD3_223425722),
  {
    a!columnsLayout(
      columns: {
        a!columnLayout(
          contents: {
            a!imageField(
              labelPosition: "COLLAPSED",
              images: {
                a!documentImage(
                  document:cons!SR_LEFT,
                  link: a!dynamicLink(
                    saveinto: {
                      a!save(
                        target: local!index,
                        value: local!index-1,
                      )
                    },
                    showWhen: local!index>1
                  )
                ),
              },
              size: "LARGE",
              isThumbnail: false,
              style: "STANDARD"
            )
          }
        ),
        a!columnLayout(
          contents: {
            a!imageField(
              labelPosition: "COLLAPSED",
              images: a!documentImage(
                document: local!seletedPicture
              ),
              size: "LARGE",
              isThumbnail: false,
              style: "STANDARD"
            )
          }
        ),
        a!columnLayout(
          contents: {
            a!imageField(
              labelPosition: "COLLAPSED",
              images: a!documentImage(
                document:cons!SR_RIGHT,
                link: a!dynamicLink(
                  saveinto: {
                    a!save(
                      target: local!index,
                      value: local!index+1,
                    )
                  },
                  showWhen: local!index

24 replies

stefanhelzle0001
Brainy
June 20, 2022

That would require a custom built component plugin.

richardm900458
June 20, 2022

Hello saidivya,

may I ask why you need exactly that element?
is there no other suitable UI element you can use?

stewart.burchell
June 20, 2022

Whilst you couldn't have an auto-scrolling gallery, you could use the interface refresh capability to cycle through a set number of images.

richardm900458
June 20, 2022

i was exactly thinking something like that :)