oulan / iui

Automatically exported from code.google.com/p/iui
MIT License
0 stars 0 forks source link

Add support for scrolling named anchors into view. #155

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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 commented 9 years ago
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 commented 9 years ago
See also Issue #23

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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago

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

GoogleCodeExporter commented 9 years ago
Issue 220 has been merged into this issue.

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

GoogleCodeExporter commented 9 years ago
Issue 23 has been merged into this issue.

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

GoogleCodeExporter commented 9 years ago
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