Page 1 of 1

How to move scroll to pages?

Posted: Thu Nov 05, 2015 12:37 pm
by a.ebbini
Dear Support Team,
i have button its function to move scroll to specific page. i see page source there is a tables that contain page with class assign to stiWebViewerPageShadow style. i try to get pages top position throw jquery below

Code: Select all

   
            var TableID = '';
            var TableTopPosition = '';
            var Tables = jQuery(".stiWebViewerPageShadow");
            for (var i = 0; i < Tables.length; i++) {
                TableID = 'table[class="stiWebViewerPageShadow"]' + ':eq(' + i + ')'
                TableTopPosition = TableTopPosition + ',' + jQuery(TableID).position().top
            }
but the problem Tables variable dosen't retrive those tables.

My question can you catch with me what is problem, or if you have any alternative way to make this job.

Re: How to move scroll to pages?

Posted: Thu Nov 05, 2015 1:33 pm
by a.ebbini
Dear Support Team,
I find a way to get pages position throw this jQuery script below :

Code: Select all

            var TableTopPosition = [];
            var Tables = jQuery("#webReportTableFrame_ctl00_bodyContentPlaceHolder_StiCallbackPanel_RV").contents().find('iframe').contents().find('.stiWebViewerPageShadow');
            for (var i = 0; i < Tables.length; i++) {
                TableTopPosition.push(jQuery(Tables[i]).position().top)
            }
jQuery('html, body').animate({ scrollTop: TableTopPosition[PageNumber] }, duration);
Now i want to know if you recommend this way of getting pages position, and if not i need another way this urgent.

Re: How to move scroll to pages?

Posted: Fri Nov 06, 2015 2:22 pm
by Vladimir
Hello,

The ID of the viewer component should not change, so your code should work correctly.

Thank you.

Re: How to move scroll to pages?

Posted: Fri Nov 06, 2015 6:05 pm
by a.ebbini
I am put StiWebViewer in callback panel and the callback panel in ContentPlaceHolde and all of these controls i will never change its id names. and as you said if all these never change this code line :

Code: Select all

var Tables = jQuery("#webReportTableFrame_ctl00_bodyContentPlaceHolder_StiCallbackPanel_RV").contents().find('iframe').contents().find('.stiWebViewerPageShadow');
will be correct always it is true.

Re: How to move scroll to pages?

Posted: Mon Nov 09, 2015 6:11 am
by Vladimir
Hello,

Yes, these IDs are statically defined, dynamically and programmatically should not change.

Thank you.