# When I use horizontal scroll img can't fixed correctly

**URL:** <https://forum.ionicframework.com/t/when-i-use-horizontal-scroll-img-cant-fixed-correctly/88108>\
**Category:** ionic-v1\
**Created:** [April 27, 2017, 4:21pm UTC](https://forum.ionicframework.com/t/when-i-use-horizontal-scroll-img-cant-fixed-correctly/88108 "2017-04-27T16:21:42Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aklis](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@Aklis](https://forum.ionicframework.com/u/Aklis)\
**Post date:** [April 27, 2017, 4:21pm UTC](https://forum.ionicframework.com/t/when-i-use-horizontal-scroll-img-cant-fixed-correctly/88108/1 "2017-04-27T16:21:42Z")

</div>

Hello guys. I need to horizontal scroll with img but when I add to much img, it doesn’t fixed correctly into screen. Here is the code

```auto
<ion-content overflow-scroll="true">
              <div class="statementHeader"> Reading</div>
              <ion-scroll direction="x" zooming="false" delegate-handle="horizontal" horizontal-scroll-fix="mainScroll">
                <div class="row" id="row">
                  <ion-item ng-repeat="readingbook in readingbooks">
                    <img id="profilbookimg" src="{{readingbook.img}}">
                  </ion-item>
                </div>
              </ion-scroll>
              <div class="statementHeader">Will Read</div>
              <ion-scroll direction="x">
                <div class="row" id="row">
                  <ion-item ng-repeat="willreadbook in willreadbooks">
                    <img id="profilbookimg" ng-src="{{willreadbook.img}}">
                  </ion-item>
                </div>
              </ion-scroll>
              <div class="statementHeader"> Read</div>
              <ion-scroll direction="x">
                <div class="row" id="row">
                  <ion-item ng-repeat="readbook in readbooks" >
                   <img id="profilbookimg" ng-src="{{readbook.img}}">
                 </ion-item>
               </div>
             </ion-scroll>
</ion-content>

```

Here is the my css code:

```auto
.profil-view #profilbookimg{
	min-width: 100%;
	height: 200px;
	margin-left: 10px;
}

```

My problem is books not seing correctly in reading part. When i give a style in row id like `width:500%;` this time it’s scrolling too much.  
 ![image](https://global.discourse-cdn.com/ionicframework/original/3X/7/f/7fab99a715d5135c9d673dc839fd251520af5c11.JPG)

---

<div class="post-metadata">

**Author:** ![Aklis](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@Aklis](https://forum.ionicframework.com/u/Aklis)\
**Post date:** [April 28, 2017, 3:13pm UTC](https://forum.ionicframework.com/t/when-i-use-horizontal-scroll-img-cant-fixed-correctly/88108/2 "2017-04-28T15:13:21Z")

</div>

Is there anyone who know the solution guys 🙂

---

<div class="post-metadata">

**Author:** ![thesourav](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@thesourav](https://forum.ionicframework.com/u/thesourav)\
**Post date:** [April 29, 2017, 4:42am UTC](https://forum.ionicframework.com/t/when-i-use-horizontal-scroll-img-cant-fixed-correctly/88108/3 "2017-04-29T04:42:51Z")

</div>

Can you share a plunkr/codepen example

---

<div class="post-metadata">

**Author:** ![Aklis](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@Aklis](https://forum.ionicframework.com/u/Aklis)\
**Post date:** [April 29, 2017, 7:49am UTC](https://forum.ionicframework.com/t/when-i-use-horizontal-scroll-img-cant-fixed-correctly/88108/4 "2017-04-29T07:49:31Z")

</div>

Here is the my codeopen example but it doesn’t work correctly. When you put into different number of img into ion item you can see the problem

---

<div class="post-metadata">

**Author:** ![thesourav](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@thesourav](https://forum.ionicframework.com/u/thesourav)\
**Post date:** [April 29, 2017, 7:42pm UTC](https://forum.ionicframework.com/t/when-i-use-horizontal-scroll-img-cant-fixed-correctly/88108/5 "2017-04-29T19:42:42Z")

</div>

> [@Aklis](#):
>
> [https://codepen.io/Serhattan/pen/RVpdoN](https://codepen.io/Serhattan/pen/RVpdoN)

you have to provide some img data. right now its blank

---

<div class="post-metadata">

**Author:** ![Aklis](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@Aklis](https://forum.ionicframework.com/u/Aklis)\
**Post date:** [April 29, 2017, 8:22pm UTC](https://forum.ionicframework.com/t/when-i-use-horizontal-scroll-img-cant-fixed-correctly/88108/6 "2017-04-29T20:22:28Z")

</div>

Now you can see the photos 🙂 Unfortunately I didn’t understand why codepen convert the image scrolling form. However when i write same code into ionic it can be scroll the photos.  
[http://codepen.io/Serhattan/pen/RVpdoN?editors=1000](http://codepen.io/Serhattan/pen/RVpdoN?editors=1000)

---

<div class="post-metadata">

**Author:** ![thesourav](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@thesourav](https://forum.ionicframework.com/u/thesourav)\
**Post date:** [April 29, 2017, 8:51pm UTC](https://forum.ionicframework.com/t/when-i-use-horizontal-scroll-img-cant-fixed-correctly/88108/7 "2017-04-29T20:51:35Z")

</div>

So you are saying on codepen its working and on ionic its not.

Is this what you need

> **[Ionic - Horizontal Scroll](https://codepen.io/thesourav/pen/NjjPVJ)**
>
> Example of using ion-scroll to scroll horizontally and arbitrary distance Forked from Justin Noel's Pen

---

<div class="post-metadata">

**Author:** ![Aklis](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@Aklis](https://forum.ionicframework.com/u/Aklis)\
**Post date:** [April 29, 2017, 9:11pm UTC](https://forum.ionicframework.com/t/when-i-use-horizontal-scroll-img-cant-fixed-correctly/88108/8 "2017-04-29T21:11:02Z")

</div>

Ohhh sory for my bad english. I mean codepen don’t convert the scrolling form but ionic does. My problem is (in my first post’s image) when i add to much books’ image into ‘Read’ or ‘Will Read’ or ‘Reading’ part scrolling horizontal is not working correctly until I give a enough width to row tag.

---

<div class="post-metadata">

**Author:** ![thesourav](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@thesourav](https://forum.ionicframework.com/u/thesourav)\
**Post date:** [April 29, 2017, 10:29pm UTC](https://forum.ionicframework.com/t/when-i-use-horizontal-scroll-img-cant-fixed-correctly/88108/9 "2017-04-29T22:29:51Z")

</div>

Just curious, If you are scrolling horizontally why do you need rows

---

<div class="post-metadata">

**Author:** ![Aklis](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@Aklis](https://forum.ionicframework.com/u/Aklis)\
**Post date:** [May 2, 2017, 8:24pm UTC](https://forum.ionicframework.com/t/when-i-use-horizontal-scroll-img-cant-fixed-correctly/88108/10 "2017-05-02T20:24:40Z")

</div>

I used for codeopen scroll but didn’t work
