Skip to content
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

Add support for scrolling named anchors into view. #155

Open
GoogleCodeExporter opened this issue Mar 14, 2015 · 7 comments
Open

Add support for scrolling named anchors into view. #155

GoogleCodeExporter opened this issue Mar 14, 2015 · 7 comments

Comments

@GoogleCodeExporter
Copy link
Collaborator

What steps will reproduce the problem?
1. Add a link to a named anchor within the same page (ie: <a href="#id"
target="_self">id</a>)
2. Click on that link to move to the location in the page.
3. Click on a link that will move to another panel.
4. Click on the back button (browser or iui).

What is the expected output? What do you see instead?
I want to go back to the previous panel, instead nothing happens as the
browser tries to go back to the named anchor.  Clicking back again returns
to the previous panel.

What version of the product are you using? On what operating system?
iUi: release 0.20
OS: Win XP
Browsers: Safari 4.0, FF 3.5.1

Sorry if this has been asked before or is something I'm just doing wrong. 
I searched through the issues list and didn't see anything except for a
note about the same issue in the comments to issue 82.  Please let me know
if I should be using different tags on the anchor link or if I'm otherwise
doing something wrong.

Thanks!

Original issue reported on code.google.com by WesBro...@gmail.com on 28 Jul 2009 at 4:17

@GoogleCodeExporter
Copy link
Collaborator Author

I fixed this myself  with a little bit of javascript:
function scrollToElement(id) {
    var element = document.getElementById(id);
    if (element) {
        element.scrollIntoView(true);
    }
}

Called by:
<a target="_self" onclick="scrollToElement('id')">Link</a>

Cheers!

Original comment by WesBro...@gmail.com on 31 Jul 2009 at 1:03

@GoogleCodeExporter
Copy link
Collaborator Author

See also Issue #23

Original comment by msgilli...@gmail.com on 25 Sep 2009 at 8:48

@GoogleCodeExporter
Copy link
Collaborator Author

We do need to fix this in a future version of iUI.  Provide a mechanism to use 
scrollIntoView to get to named anchors.  

The workaround in comment #1 may suffice as a solution in the meantime.

Original comment by msgilli...@gmail.com on 9 Jan 2012 at 6:53

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Collaborator Author

Original comment by msgilli...@gmail.com on 9 Jan 2012 at 6:54

  • Changed title: *Add support for scrolling named anchors into view. *

@GoogleCodeExporter
Copy link
Collaborator Author

Issue 220 has been merged into this issue.

Original comment by msgilli...@gmail.com on 9 Jan 2012 at 6:58

@GoogleCodeExporter
Copy link
Collaborator Author

Issue 23 has been merged into this issue.

Original comment by msgilli...@gmail.com on 22 Jul 2012 at 9:43

@GoogleCodeExporter
Copy link
Collaborator Author

I wrote some code that does the scrollIntoView for named anchors.  It was on an 
experimental branch and is not thoroughly tested, but is worth looking at as a 
starting point:

https://code.google.com/r/msgilligan-iuiscroll/source/diff?spec=svna8caeae0f0f7a
a644d55936fd891972334bc6236&r=a8caeae0f0f7aa644d55936fd891972334bc6236&format=si
de&path=/web-app/iui/iui.js

Original comment by msgilli...@gmail.com on 22 Jul 2012 at 9:44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant