# Hashbang scroll - can't scroll up to top of content manually

**URL:** <https://forum.ionicframework.com/t/hashbang-scroll-cant-scroll-up-to-top-of-content-manually/633>\
**Category:** ionic-v1\
**Created:** [January 23, 2014, 9:30am UTC](https://forum.ionicframework.com/t/hashbang-scroll-cant-scroll-up-to-top-of-content-manually/633 "2014-01-23T09:30:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexb](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexb](https://forum.ionicframework.com/u/alexb)\
**Post date:** [January 23, 2014, 9:30am UTC](https://forum.ionicframework.com/t/hashbang-scroll-cant-scroll-up-to-top-of-content-manually/633/1 "2014-01-23T09:30:18Z")

</div>

I have a list. On each I put an ID (lets call them 1, 2, 3)

```
A <a id="1">
B <a id="2">
C <a id="3">

```

I can scroll the a specific item in the list using the following within a controller

$location.hash(“2”);  
$anchorScroll();

However, say I with this code scroll to 2, Ionic now counts 2 as the top of the content, and I can’t MANUALLY scroll up to 1 (what I get is an Ionic bounce back down to 2 at the top again)

Is there any means to set a scroll position to 2, without locking the top of the content to 2

(Using this approach to see if I can come up with another way of solving the maintain back position problem that is being discussed in the forums - as I know the ID of the detail view that was just visited - so happy to scroll with that at the top, when they come back to the list)

Thanks!

---

<div class="post-metadata">

**Author:** ![gregorypratt](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/gregorypratt/32/64031_2.png) [@gregorypratt](https://forum.ionicframework.com/u/gregorypratt)\
**Post date:** [January 23, 2014, 1:57pm UTC](https://forum.ionicframework.com/t/hashbang-scroll-cant-scroll-up-to-top-of-content-manually/633/2 "2014-01-23T13:57:46Z")

</div>

I may be wrong but I’m not sure using this method would work if you have multiple pages. Scroll halfway down A, move to B scroll two-thirds down B and more to C. Press back to B and then to A. Would the scroll position be maintained per page?

---

<div class="post-metadata">

**Author:** ![max](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/max/32/137761_2.png) [@max](https://forum.ionicframework.com/u/max)\
**Post date:** [January 23, 2014, 4:41pm UTC](https://forum.ionicframework.com/t/hashbang-scroll-cant-scroll-up-to-top-of-content-manually/633/3 "2014-01-23T16:41:41Z")

</div>

Hey @alexb, anchor scrolling won’t work in Ionic as is since we are using a custom scrolling mechanism. I’m looking into exposing something to you through the `$ionicScrollDelegate` though, issue filed here: [https://github.com/driftyco/ionic/issues/463](https://github.com/driftyco/ionic/issues/463)

---

<div class="post-metadata">

**Author:** ![alexb](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexb](https://forum.ionicframework.com/u/alexb)\
**Post date:** [January 23, 2014, 7:32pm UTC](https://forum.ionicframework.com/t/hashbang-scroll-cant-scroll-up-to-top-of-content-manually/633/4 "2014-01-23T19:32:22Z")

</div>

Hi @gregorypratt yeah I was going to do some custom business rules on top, I was just giving an explanation that made sense to describe the technical hurdle

---

<div class="post-metadata">

**Author:** ![grib](https://avatars.discourse-cdn.com/v4/letter/g/dbc845/32.png) [@grib](https://forum.ionicframework.com/u/grib)\
**Post date:** [January 30, 2014, 11:47am UTC](https://forum.ionicframework.com/t/hashbang-scroll-cant-scroll-up-to-top-of-content-manually/633/5 "2014-01-30T11:47:15Z")

</div>

As mentioned on the github ticket, I’d love to see this too. I can jump to locations with the following gotoHash() but if I scroll the page at all the position is off and obviously gotoTop() doesn’t work.

```
$scope.gotoHash = function(thehash) {

var old = $location.hash();
$location.hash(thehash);
$anchorScroll();
$location.hash(old);

};

$scope.gotoTop = function() {

$location.hash('card-chapter-wrapper');
$anchorScroll();

};
```
