简体   繁体   中英

KendoUI Accordion not getting expanded in iPad

I have a web application running on iPad. This application contains a Kendo UI Accordion inside it.

When the content of the page is more than the size of the screen and when I want to scroll, normal page scrolling happens ( as expected ). But when try to scroll the Kendo Accordion, the page scrolling happens instead of accordion scrolling ( unexpected ).

I was able partly handle this issue by applying solution given by Chris Barr .

After applying this solution the accordion is getting scrolled instead of the whole page which I wanted.

But the problem is when I click the items on the Accordion, the accordion item doesn't get expanded. How can I get to work this.

function touchScroll(id){
if(isTouchDevice()){ //if touch events exist...
    var el=document.getElementById(id);
    var scrollStartPos=0;

    document.getElementById(id).addEventListener("touchstart", function(event) {
        scrollStartPos=this.scrollTop+event.touches[0].pageY;
        event.preventDefault();
    },false);

    document.getElementById(id).addEventListener("touchmove", function(event) {
        this.scrollTop=scrollStartPos-event.touches[0].pageY;
        event.preventDefault();
    },false);
}}

Remove event.preventDefault() in touchstart event listener. It will allow you to click on links inside the scrollable area.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM