Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <html>
  <head>
    <meta charset="utf-8">
    <title>Ionic List Example</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
    
    <title>Infitine Scroll</title>

    <link href="https://code.ionicframework.com/0.9.24/css/ionic.min.css" rel="stylesheet">
    <script src="https://code.ionicframework.com/0.9.24/js/ionic.bundle.min.js"></script>
  </head>

 
  <body ng-app="listExample" nav-router animation="slide-left-right-ios7">

   
    <nav-view></nav-view>

    <script type="text/ng-template" id="/index.html">
      <view>
      <nav-page title="title">
        <content overflow-scroll="true">
          
          <ul class=“list”>
    <ul>
        <li class="item item-divider">A</li>
        <li class="item">Andrew W.K.</li>
        <li class="item">Apparat</li>
        <li class="item">Arcade Fire</li>
        <li class="item">At The Drive-In</li>
        <li class="item">Aziz Ansari</li>
    </ul>
    <ul>
        <li class="item item-divider">B</li>
        <li class="item">Battles</li>
        <li class="item">Biz Markie</li>
        <li class="item">The Black Keys</li>
        <li class="item">Blakroc</li>
        <li class="item">Broken Social Scene</li>
    </ul>
    <ul>
        <li class="item item-divider">C</li>
        <li class="item">Chromeo</li>
        <li class="item">Common</li>
        <li class="item">Converge</li>
        <li class="item">Crystal Castles</li>
        <li class="item">Cursive</li>
    </ul>
    <ul>
        <li class="item item-divider">D</li>
        <li class="item">Daft Punk</li>
        <li class="item">David Bazan</li>
        <li class="item">Death from Above 1979</li>
        <li class="item">Delorean</li>
    </ul>
    <ul>
        <li class="item item-divider">E</li>
        <li class="item">Explosions In The Sky</li>
    </ul>
    <ul>
        <li class="item item-divider">F</li>
        <li class="item">Fear Before The March Of Flames</li>
        <li class="item">The Fire Theft</li>
        <li class="item">Flight of the Conchords</li>
        <li class="item">Foo Fighters</li>
    </ul>
    <ul>
        <li class="item item-divider">G</li>
        <li class="item">The Get Up Kids</li>
        <li class="item">Girl Talk</li>
        <li class="item">godspeed you! black emperor</li>
        <li class="item">Guns N' Roses</li>
    </ul>
    <ul>
        <li class="item item-divider">H</li>
        <li class="item">Haliaway</li>
        <li class="item">Hot Chip</li>
        <li class="item">Hot Hot Heat</li>
    </ul>
    <ul>
        <li class="item item-divider">I</li>
        <li class="item">Immaculate Machine</li>
        <li class="item">Imogen Heap</li>
        <li class="item">Interpol</li>
    </ul>
    <ul>
        <li class="item item-divider">J</li>
        <li class="item">James Blake</li>
        <li class="item">Japandroids</li>
        <li class="item">Jimmy Eat World</li>
        <li class="item">The Juan MacLean</li>
    </ul>
    <ul>
        <li class="item item-divider">K</li>
        <li class="item">Kings Go Forth</li>
        <li class="item">Kings of Leon</li>
    </ul>
    <ul>
        <li class="item item-divider">L</li>
        <li class="item">Lady Sovereign</li>
        <li class="item">LCD Soundsystem</li>
        <li class="item">Lykke Li</li>
    </ul>
    <ul>
        <li class="item item-divider">M</li>
        <li class="item">M.I.A.</li>
        <li class="item">Madball</li>
        <li class="item">Major Lazer</li>
        <li class="item">Mount Kimbie</li>
    </ul>
    <ul>
        <li class="item item-divider">N</li>
        <li class="item">Neutral Milk Hotel</li>
        <li class="item">New Ruins</li>
        <li class="item">Nirvana</li>
    </ul>
    <ul>
        <li class="item item-divider">O</li>
        <li class="item">Of Montreal</li>
        <li class="item">Open Hand</li>
        <li class="item">Outkast</li>
    </ul>
    <ul>
        <li class="item item-divider">P</li>
        <li class="item">Parts and Labor</li>
        <li class="item">Pharoahe Monch</li>
        <li class="item">Pixies</li>
    </ul>
    <ul>
        <li class="item item-divider">R</li>
        <li class="item">Radiohead</li>
        <li class="item">Ratatat</li>
        <li class="item">RJD2</li>
        <li class="item">The Roots</li>
    </ul>
    <ul>
        <li class="item item-divider">S</li>
        <li class="item">Sam Cooke</li>
        <li class="item">Santigold</li>
        <li class="item">Shai Hulud</li>
        <li class="item">Sinai Beach</li>
        <li class="item">Sleigh Bells</li>
        <li class="item">Small Sins</li>
        <li class="item">Snoop Dogg</li>
        <li class="item">Spoon</li>
        <li class="item">Stars</li>
        <li class="item">Strongarm</li>
        <li class="item">Sunny Day Real Estate</li>
    </ul>
    <ul>
        <li class="item item-divider">T</li>
        <li class="item">Ted Leo & The Pharmacists</li>
        <li class="item">T-Pain</li>
        <li class="item">Thrice</li>
        <li class="item">TV On The Radio</li>
        <li class="item">Two Gallants</li>
    </ul>
</ul>
        </content>
      </nav-page>
      </view>
    </script>
    
    <!--
      This template loads when the '/movie/:movieId' url is matched (app.js)
      'movie' is a $scope variable which was created in MovieDetailCtrl (controllers.js)
      The MovieDetailCtrl gets data from the MovieService (service.js)
    -->
    <script type="text/ng-template" id="/movie.html">
      <view>
      <nav-page title="title">
        <content has-header="true" padding="true">
          <h1>{{ movie.title }}</h1>
          <dl>
            <dt>Description:</dt>
            <dd>{{ movie.description }}</dd>
          </dl>
          <dl>
            <dt>Released:</dt>
            <dd>{{ movie.released }}</dd>
          </dl>
          <dl>
            <dt>Director:</dt>
            <dd>{{ movie.director }}</dd>
          </dl>
          <dl>
            <dt>Rating:</dt>
            <dd>{{ movie.rating }}</dd>
          </dl>
        </content>
      </nav-page>
      </view>
    </script>


  </body>
</html>
            
          
!
            
              
.scroll{
position:absolute !important;
top:0 !important;
bottom: 0 !important;
left: 0 !important;
right: 0 !important;
overflow:scroll !important;
  
}


.item-divider{
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0px;
    z-index: 3 !important;
}
            
          
!
            
              angular.module('listExample', ['ionic', 'ngAnimate'])

.config(function($stateProvider, $urlRouterProvider) {

  // Set up the initial routes that our app will respond to.
  // These are then tied up to our nav router which animates and
  // updates a navigation bar
  $stateProvider.state('indexView', {
    url: '/',
    templateUrl: '/index.html',
    controller: 'MovieIndexCtrl'
  })

  // if the url matches something like /movie/88 then this route
  // will fire off the MovieDetailCtrl (controllers.js)
  .state('movieView', {
    url: '/movie/:movieId',
    templateUrl: '/movie.html',
    controller: 'MovieDetailCtrl'
  });

  // if none of the above routes are met, use this fallback
  $urlRouterProvider.otherwise('/');

})

.controller('MovieIndexCtrl', function($scope, MovieService, $timeout) {
  
  // "MovieService" is a service returning mock data (services.js)
  // the returned data from the service is placed into this 
  // controller's scope so the template can render the data
  $scope.movies = MovieService.all();

  $scope.title = "Completely Random Collection Of Movies";

  // Method called on infinite scroll
  // Receives a "done" callback to inform the infinite scroll that we are done
  $scope.loadMore = function(done) {
    $timeout(function() {
      $scope.movies.push({
        id: 'tt0114814',
        title: 'Usual Suspects',
        released: '1995',
        description: 'A boat has been destroyed, criminals are dead, and the key to this mystery lies with the only survivor and his twisted, convoluted story beginning with five career crooks in a seemingly random police lineup.',
        director: 'Bryan Singer',
        rating: 8.3
      });
      done();
    }, 1000);
  }
})

// Controller that shows more detailed info about a movie
.controller('MovieDetailCtrl', function($scope, $stateParams, MovieService) {
  // "MovieService" is a service returning mock data (services.js)
  $scope.movie = MovieService.get($stateParams.movieId);
  $scope.title = "Movie Info";
})

.factory('MovieService', function() {
  // Might use a resource here that returns a JSON array

  // Some fake testing data
  var movies = [
    {
      id: 'tt0080487',
      title: 'Caddyshack',
      released: '1980',
      description: 'An exclusive golf course has to deal with a brash new member and a destructive dancing gopher.',
      director: 'Harold Ramis',
      rating: 7.2
    },
    {
      id: 'tt0087332',
      title: 'Ghostbusters',
      released: '1984',
      description: 'Three unemployed parapsychology professors set up shop as a unique ghost removal service.',
      director: 'Ivan Reitman',
      rating: 7.8
    },
    {
      id: 'tt0097428',
      title: 'Ghostbusters II',
      released: '1989',
      description: 'The discovery of a massive river of ectoplasm and a resurgence of spectral activity allows the staff of Ghostbusters to revive the business.',
      director: 'Ivan Reitman',
      rating: 6.4
    },
    {
      id: 'tt0107048',
      title: 'Groundhog Day',
      released: '1993',
      description: 'A weatherman finds himself living the same day over and over again.',
      director: 'Harold Ramis',
      rating: 8.1
    },
    {
      id: 'tt0116778',
      title: 'Kingpin',
      released: '1996',
      description: 'A star bowler whose career was prematurely "cut off" hopes to ride a new prodigy to success and riches.',
      director: 'Bobby Farrelly, Peter Farrelly',
      rating: 6.8
    },
    {
      id: 'tt0335266',
      title: 'Lost in Translation',
      released: '2003',
      description: 'A faded movie star and a neglected young wife form an unlikely bond after crossing paths in Tokyo.',
      director: 'Sofia Coppola',
      rating: 7.8
    },
    {
      id: 'tt0079540',
      title: 'Meatballs',
      released: '1979',
      description: 'Wacky hijinks of counselors and campers at a less-than-average summer camp.',
      director: 'Ivan Reitman',
      rating: 5.9
    },
    {
      id: 'tt0128445',
      title: 'Rushmore',
      released: '1998',
      description: 'The king of Rushmore prep school is put on academic probation.',
      director: 'Wes Anderson',
      rating: 7.7
    },
    {
      id: 'tt0096061',
      title: 'Scrooged',
      released: '1988',
      description: 'A cynically selfish TV executive gets haunted by three spirits bearing lessons on Christmas Eve.',
      director: 'Richard Donner',
      rating: 6.9
    },
    {
      id: 'tt0083131',
      title: 'Stripes',
      released: '1981',
      description: 'Two friends who are dissatisfied with their jobs decide to join the army for a bit of fun.',
      director: 'Ivan Reitman',
      rating: 6.8
    },
    {
      id: 'tt0362270',
      title: 'The Life Aquatic with Steve Zissou',
      released: '2004',
      description: 'With a plan to exact revenge on a mythical shark that killed his partner, oceanographer Steve Zissou rallies a crew that includes his estranged wife, a journalist, and a man who may or may not be his son.',
      director: 'Wes Anderson',
      rating: 7.2
    },
    {
      id: 'tt0120483',
      title: 'The Man Who Knew Too Little',
      released: '1997',
      description: 'Murray is mistaken for a spy and must stop a plot to assasinate international leaders at a banquet.',
      director: 'Jon Amiel',
      rating: 6.4
    },
    {
      id: 'tt0265666',
      title: 'The Royal Tenenbaums',
      released: '2001',
      description: 'An estranged family of former child prodigies reunites when one of their member announces he has a terminal illness.',
      director: 'Wes Anderson',
      rating: 7.5
    },
    {
      id: 'tt0103241',
      title: 'What About Bob?',
      released: '1991',
      description: 'A successful psychiatrist loses his mind after one of his most dependent patients, a highly manipulative obsessive-compulsive, tracks him down during his family vacation.',
      director: 'Frank Oz',
      rating: 6.8
    },
    {
      id: 'tt1156398',
      title: 'Zombieland',
      released: '2009',
      description: 'A shy student trying to reach his family in Ohio, and a gun-toting tough guy trying to find the Last Twinkie and a pair of sisters trying to get to an amusement park join forces to travel across a zombie-filled America.',
      director: 'Ruben Fleischer',
      rating: 7.7
    }
  ];

  return {
    all: function() {
      return movies;
    },
    get: function(movieId) {
      // Simple index lookup
      for(var i=0, l=movies.length; i < l; i++) {
        if(movies[i].id == movieId) {
          return movies[i];
        }
      }
    }
  }
});
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console