最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - Ionic Framework: how to disable bounce effect in slider box? - Stack Overflow

matteradmin4PV0评论

I'm currently working on an app that has fullscreen slides, the thing is that I want to be able to stop the bounce effect whenever I'm either on the first slide or the last slide.

That is, if I'm on the start slide, disable the bouncing effect when dragging from the left. Likewise, if I'm on the last slide, disable the bouncing effect when dragging from the right. Is there a way to implement this?

(I know that Ionic has attribute name hasBounce, but that only works for the ion-content directive, and it only works for the top and the bottom)

I'm currently working on an app that has fullscreen slides, the thing is that I want to be able to stop the bounce effect whenever I'm either on the first slide or the last slide.

That is, if I'm on the start slide, disable the bouncing effect when dragging from the left. Likewise, if I'm on the last slide, disable the bouncing effect when dragging from the right. Is there a way to implement this?

(I know that Ionic has attribute name hasBounce, but that only works for the ion-content directive, and it only works for the top and the bottom)

Share Improve this question edited Apr 27, 2020 at 10:56 Tomislav Stankovic 3,12617 gold badges37 silver badges43 bronze badges asked May 14, 2014 at 22:20 user3596620user3596620 372 silver badges4 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 5

You could use has-bouncing on ion-content

<ion-content 
   has-bouncing="false"
   start-y="55"
   padding="true"
   has-tabs="true"
   has-header="true">

working in ionic 1.3.1 ;)

i searched in lib/ionic/jsionic.bundle.js

.directive('ionSlideBox', [
  '$animate',
  '$timeout',
  '$pile',
  '$ionicSlideBoxDelegate',
  '$ionicHistory',
  '$ionicScrollDelegate',
function($animate, $timeout, $pile, $ionicSlideBoxDelegate, $ionicHistory, $ionicScrollDelegate) {
  return {
    restrict: 'E',
    replace: true,
    transclude: true,
    scope: {
      autoPlay: '=',
      doesContinue: '@',
      slideInterval: '@',
      showPager: '@',
      pagerClick: '&',
      disableScroll: '@',
      onSlideChanged: '&',
      activeSlide: '=?',
      bounce: '@'
    },
....

, bounce: '@'

so bounce is working :)

<ion-slide-box bounce="false" ></ion-slide-box>
Post a comment

comment list (0)

  1. No comments so far