Problem in browsing speed with slideBox and Swipe event


#1

Hi all,
First thank you for this great framework : )

I really need your help please,

I am working on an app, and I need in it to show list of images and swipe between them…
when I tried to use slide box the app going slowly because in one page I must load a lot of images
when i tried to put each one in a single page and swipe between them the app go more and more slowly !!! I don’t Know why !!!

In second try, I used $ionicGesture.on(‘swiperight’, function(event){…} like this example

Can anyone suggest to me a solution ??


#2

Hi I think that a possible solution is to display only a portion of your images via slidebox and not all of them.

You can use a temporary $scope.variable where insert the images that you want to display, and when the user swipe left you insert a new element at the end of the box and remove the first, while when the user swipe right you make contrary. Ionic/AngularJS rebuild your slidebox automatically or you can use a .update() to refresh.

Remember to save the active swipe. I don’t know if this works. It’s only an idea.

M.


#3

Thank you very much @ziobudda ,
Really your idea looks great
but can you give me a hint to start test it ? :blush:
from when i should start ?
I’m new to angular and ionic and at the present time I am trying to develop my skills.

Thanks in advance


#4

When I rethink in my app and my needs, I wonder…

Is there a problem in routing with ui-sref ??
and what is the difference between href and ui-sref ?


#5

href is a regular HTML element, ui-sref is linked to the angular routes, here’s the github repo for ui-router: Angular UI/ ui-router.

When you use angular routing You let Angular handle all state changes, you can better manage Your controllers, nest views, etc.


#6

Thank you @psyche
can I ask you another question please? or anyone can help me, I am compelled

In my app, I have a lot of states, when i used this

href="#/app/Page1"

to go from parent to his child, it moves quickly.

but when i need to go from child to other child (I mean the templateUrl in a state be as this

templateUrl: "templates/Level1/Level2/Level3/child1.html"
templateUrl: "templates/Level1/Level2/Level3/child2.html"

)

and using ui-sref to go from child1 to child2 Or from Level1 to another page in Level1, it moves very slowly !!!

I read the github repo for ui-router but I don’t find the answer, and don’t know how to fix this very big problem :’(


#7

Can You show me more of Your code? Do you have a github/bitBucket repo?
Or can You maybe paste how You wrote Your states? and how You handle changing states?


#8

Thank you very much @psyche, I’ve resolved the problem, it was from the very large size of the images ^^!


#9

Great! I don’t feelI’ve helped a lot, but I’m very glad You found a solution :wink: