onscroll

Recyclerview fast scroll items disappear

前提是你 提交于 2019-12-10 18:47:03
问题 I am using GridLayoutManager with recyclerview, when i fast scroll down one item out of four visible grid items (bottom right ) is moved further down, I am using this tutorial to implement fast scroll and fast scroll indicator here 回答1: Guess i've found the solution. Looks like when the Recycled Views are attached to the Window again, their state is changed to Invisible (IDK why). All we have to do is make it visible again. Fortunately, RecyclerView.Adapter class has a method to handle when a

Javascript - execute multiple different window.onscroll

僤鯓⒐⒋嵵緔 提交于 2019-12-08 23:33:50
问题 I am facing a little problem here. I have basic knowledge about Javascript and i want to do the following: Right now, when you scroll down, the menu will get smaller. when you go back up, it will return to normal. I call this event with window.onscroll: var diff = 0; function effects(){ var topDistance = (document.documentElement && document.documentElement.scrollTop) || document.body.scrollTop; var clientWidth = window.innerWidth || document.documentElement.clientWidth || document.body

Why window onscroll event does not work?

a 夏天 提交于 2019-12-07 05:42:17
问题 I want to execute the window onscroll event, but I don't know why it doesn't work on all browsers(firefox, chrome, etc), and there is no errors occurred. Full code: var elem = document.getElementById('repeat'); var show = document.getElementById('show'); for (i = 1; i <= 300; i++) { elem.innerHTML += i + "<br/>"; } window.onscroll = function () { show.innerHTML = document.body.scrollTop; }; #show { display:block; position:fixed; top:0px; left:300px; } <pre id="repeat"></pre> <div style=

AndEngine - scroll sprites up and down

て烟熏妆下的殇ゞ 提交于 2019-12-06 13:23:16
I am a beginner andengine user and I need your help. I have created a class MySprite extending sprite and I want the sprite to move up and down on the y - coordinate when I slide with the finger on the Screen by touching only the sprite. I have tried to achieve this by implementing IScrollDetectorListener and IonSceneTouchListener but the Problem is: I can touch anywhere and my sprites moves. I would be glad if someone could help. For more Details just comment :) Sprite mySprite = new Sprite(x, y, textureRegion, this.getVertexBufferObjectManager()) { @Override public boolean onAreaTouched

onscroll won't work with IE

故事扮演 提交于 2019-12-05 10:22:01
i have a "body" with onScroll="Scroll()" . Scroll method should, well, scroll some div as user scrolls the page. Scroll(): function Scroll() { var el = document.getElementById('controlBox'); var ScrollTop = document.body.scrollTop; el.style.top = ScrollTop + "px"; } It works fine with Chrome and FF, but IE won't cooperate. What's wrong here? Remove the onScroll from your body tag, and try adding window.onscroll = Scroll; to your javascript, outside of the function. 来源: https://stackoverflow.com/questions/4709673/onscroll-wont-work-with-ie

onScrollChanged() never fired on Android 4.0

我们两清 提交于 2019-12-05 09:21:39
I have a GridView that shows images from your gallery. When user scrolls the list, details about the image animate in from the left. I implemented this in the class that defines custom layout for the GridView item. It extends LinearLayout . OnScrollChangedListener mScrollListener = new OnScrollChangedListener() { @Override public void onScrollChanged() { if (!getGlobalVisibleRect(r)) { resetAnimation(); } else { if (checkBounds()) { showInfo(); } } else { hideInfo(); } Method resetAnimation() resets the animation if it's view is not visible on screen. Method checkBounds() compares the Rect got

Weird onScroll event triggered after onScale event

随声附和 提交于 2019-12-05 06:05:50
I have an app that uses a SimpleOnScaleGestureListener and a SimpleOnGestureListener together. Whenever I do a pinch zoom I get the expected onScale's, but when I lift off I see a weird onScroll that has a start position from the beginning of the pinch zoom and an end position from the end of the pinch zoom. My question is, can I prevent the bogus onScroll? Here's the code: @Override public boolean onTouchEvent(MotionEvent event) { // Log every event. Log.d(TAG, Here.at() + String.format("Event: %d, Time: %d X: %f, Y: %f", event.getAction(), event.getEventTime(), event.getX(), event.getY() ));

onScale and Canvas - how to adjust origin point after zooming image?

风流意气都作罢 提交于 2019-12-03 16:09:04
I have a very simple test app with a custom component MyView.java - which displays a scrollable and scalable image (representing a board in a Scrabble-like word game): 1) In my scale listener I adjust the scale factor: public boolean onScale(ScaleGestureDetector detector) { mScale *= detector.getScaleFactor(); // XXX how to adjust mOffsetX and mOffsetY ? XXX constrainZoom(); constrainOffsets(); invalidate(); return true; } 2) And then in the drawing method of my custom component I apply the translation and scale factor: protected void onDraw(Canvas canvas) { super.onDraw(canvas); canvas

Firefox scrollTop problem

做~自己de王妃 提交于 2019-12-02 05:57:30
问题 I have a problem with Firefox scrollTop value and onscroll event. This works great in IE, Safari and Chrome but Firefox seems to lag. I tried to update some background position with the onscroll event, but when I take the handle and drag it up and down quickly, Firefox stops updating the scrollTop value and it causes some lag in my app. You can try this code and look in the Firefox console when dragging the handle and you will see the values something stops the updating : function

Firefox scrollTop problem

折月煮酒 提交于 2019-12-01 22:46:14
I have a problem with Firefox scrollTop value and onscroll event. This works great in IE, Safari and Chrome but Firefox seems to lag. I tried to update some background position with the onscroll event, but when I take the handle and drag it up and down quickly, Firefox stops updating the scrollTop value and it causes some lag in my app. You can try this code and look in the Firefox console when dragging the handle and you will see the values something stops the updating : function SaveScrollLocation () { console.log(document.documentElement.scrollTop); } window.onscroll=SaveScrollLocation ;