-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for mobile and responsive designs #43
Comments
Can you be more specific? what are you trying to achieve and what's the problem you're seeing? |
I'm seeing a flickr on iOS (ipad, iphone4s, iphone5) when clicking a navigation link. note these are #hash links. Is this something I need to use Local scrollTo for? Code sample below:
|
After reviewing some closed issues, I updated to localScroll. Is there a way to use localScroll to go to the next element as in the code above (next-section)? |
Also, is there a way to reference the element (#hash) that's being scrolled to in a callback function? onAfter: function(anchor, settings) { |
Looking at the code, I think the first argument should be that element, but the code is wrong and you get the exact "target" setting (which is not always this that you expect). I just changed that and commited as 1.4.6, get the last version. As for the other question, you could use localScroll and then only add a code that triggers a "click" event on the next link. You need to handle the find-the-next part which seems like you got it already. You could include serialScroll in the mix maybe, it can play nice with localScroll to some extent, but you're probably better off coding that part yourself. |
@flesler Thanks for taking a look! updating this file caused an error: Uncaught TypeError: Object [object Object] has no method 'localScroll' should the implementation change? |
and my code is:
|
You replaced what? I meant that you upgrade scrollTo with the version on Github, localScroll remains untouched. |
I see. I saw you had committed a change on github for localScroll library so I assumed that was the update 1.4.6 you were referencing. I will update scrollTo library. Would the callback then be:
|
$(anchor).addClass('current'); On Wed, May 22, 2013 at 12:41 PM, Jess Dale notifications@github.comwrote:
Ariel Flesler |
So far no issues across devices. Well done! I am working through the piece I mentioned earlier with scrolling to next. Here is what I have:
and the HTML:
If I understand correctly, localScroll isn't working in this case because the href has not been defined. Is there a way to tell localScroll to use the $next variable as scroll position similarly to the way it works in scrollTo? |
Would filtering be a better option? |
Maybe filtering along with the "lazy" setting on true, but simply unbindings seems like the easiest approach. |
thank you! I couldn't find an example of filtering being used in the demo. Could you point me to a link? Also, not sure what you mean by unbindings. |
Was looking again through the demos and could not find an example use of filter or lazy (as well as event). Maybe they could be included in a future version of localScroll documentation? For now, is there a way to explicitly set the anchor to a specific DOM Element?
|
I got confused with another issue I replied to recently. What you need to do is save the last clicked link, or scrolled page, and on the click handler of the "next" link find the following page and scroll to it manually, by manually I mean use scrollTo, localScroll won't do for this case. |
I see, so you're saying to set the href of .next a in the After function. for example:
Wouldn't it be easier to allow localscroll to accept params the way .scrollTo( target, settings ); does? |
You should be adding the return false or event.preventDefault(), that goes without saying. I assumed you were doing that. |
Hi, |
Any plans for this?
The text was updated successfully, but these errors were encountered: