亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

javascript - How to return to the original position of the list page from the details page on the mobile terminal?
給我你的懷抱
給我你的懷抱 2017-07-05 10:37:41
0
1
1083

1. What we are currently doing is to locate the original position when returning from the details page to the list page in the angular mobile terminal.
2. My code is to record the current position on the list page

document.addEventListener('touchstart', function (e) {
    console.log(angular.element(e.target)[0].offsetTop);
    var eleTop = angular.element(e.target)[0].offsetTop;
    localStorage.setItem("top", eleTop);
 }, false);

Return function: But the value printed here is no longer the value originally stored, but the position when clicking return.

function goBack() {
            console.log(localStorage.getItem("top"));            
                history.back();
        }

Please tell me how to locate the value recorded in the list page, or is there any better way?
Thanks!

給我你的懷抱
給我你的懷抱

reply all(1)
某草草

Change entering the details page to js trigger, record the current position before jumping, enter the page to verify whether there is this value, if so, let the page stay at this position, and clear this value, if not, skip. The idea is probably this, the code is completed by itself. If you don’t understand that part, you can ask me. If you want the complete code, don’t ask me

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template