npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

stz-scroll-into-view

v1.0.7

Published

Angular scroll to an element inside some view when ng-repeat is rendered or all images are loaded or both cases or scroll to static attribute

Downloads

8

Readme

stz-scroll-into-view

stz-scroll-into-view on NPM stz-scroll-into-view on Bower

This directive allows to scroll to a custom Node list array element inside a parent container.

Can be used along with stz-image-load directive if all of the child elements are images or contain images to scroll to a particular element only when all images are loaded or with stz-last-repeat directive to consider the ng-repeat presence and scroll after ng-repeat is rendered. Or can make use of both ng-repeat and images combined.

IE9+.

Demo

Static List Example:

By default the list view will be scrolled to the element that has [stz-s-i-v-ele="true"]attribute.

<ul stz-scroll-into-view>
  <li stz-s-i-v-ele="false">Hidden</li>
  <li stz-s-i-v-ele="not-to-me">Hidden</li>
  <li stz-s-i-v-ele="let-me-think...no">Hidden</li>
  <li stz-s-i-v-ele="true">Visible</li>
  <li stz-s-i-v-ele="scroll-to-the-guy-above-me">Maybe visible, too.</li>
</ul>

Static List Example With Watcher:

where isTimeToScrollScopeVar will be resolved to 'scroll-to-me'.

<ul stz-scroll-into-view="isTimeToScrollScopeVar">
  <li stz-s-i-v-ele="false">Hidden</li>
  <li stz-s-i-v-ele="false">Hidden</li>
  <li stz-s-i-v-ele="scroll-to-me">Hidden</li>
  <li stz-s-i-v-ele="false">Hidden</li>
  <li stz-s-i-v-ele="false">Hidden</li>
</ul>

Static List Example With Images:

<div stz-scroll-into-view stz-s-i-v-img>
  <img src="placehold.it/800x600/8A8BA6/CACBF2/" stz-s-i-v-ele="false" stz-image-load alt="I think I deserve to be scrolled to!"/>
  <img src="placehold.it/800x620/8A8BA6/CACBF2/" stz-s-i-v-ele="true" stz-image-load alt="I think I deserve to be scrolled to!"/>
  <img src="placehold.it/800x640/8A8BA6/CACBF2/" stz-s-i-v-ele="false" stz-image-load alt="I think I deserve to be scrolled to!"/>
  <img src="placehold.it/800x660/8A8BA6/CACBF2/" stz-s-i-v-ele="no" stz-image-load alt="I think I deserve to be scrolled to!"/>
  <img src="placehold.it/800x680/8A8BA6/CACBF2/" stz-s-i-v-ele stz-image-load alt="I think I deserve to be scrolled to!"/>
</div>

Static List Example With Extra Parent that should be scrolled to top:

stz-scroll-into-view element is used by default.

<section id="content">
  <h1>The most amazing title ever!!!</h1>
  <ul stz-scroll-into-view stz-s-i-v-parent-id="content">
    <li stz-s-i-v-ele="0">Maybe visible, too.</li>
    <li stz-s-i-v-ele="false">Maybe noticable, too.</li>
    <li stz-s-i-v-ele="no-scroll-for-me">Maybe valuable, too.</li>
    <li stz-s-i-v-ele="true">Maybe managable, too.</li>
    <li stz-s-i-v-ele="scroll-to-the-guy-above-me">Maybe available, too.</li>
  </ul>
</section>

Dynamic List Example:

where scroll.isActive is expected to be true.

<ul stz-scroll-into-view stz-s-i-v-ng-repeat>
  <li ng-repeat="scroll in scrollSuperCollection" stz-s-i-v-ele="{{scroll.isActive}}" stz-last-repeat>{{scroll.title}}</li>
</ul>

Dynamic List Example With Watcher:

where scrollAwesomeIndex can be watched to be defined or any other scope param can be passed. Let it be resolved to say 7 here and scrollAwesomeList will have 10 elements.

<ul stz-scroll-into-view="scrollAwesomeIndex" stz-s-i-v-ng-repeat>
  <li ng-repeat="scroll in scrollAwesomeList track by $index" stz-s-i-v-ele="{{$index}}" stz-last-repeat>{{scroll.title}}</li>
</ul>

Dynamic List Example With Images:

where scroll.isActive is expected to be true.

<ul stz-scroll-into-view stz-s-i-v-ng-repeat stz-s-i-v-img>
  <li ng-repeat="scroll in scrollAwesomeList track by $index" stz-s-i-v-ele="{{scroll.isActive}}" stz-last-repeat>
    <img ng-src="placehold.it/8{{$index % 5}}0x6{{$index % 10}}0/8A8BA6/CACBF2/" stz-image-load alt="I think I deserve to be scrolled to!"/>
  </li>
</ul>

Dynamic List Example With Images and Watcher:

where scrollAwesomeIndex can be watched to be defined or any other scope param can be passed. Let it be resolved to say 7 here and scrollAwesomeList will have 10 elements. The scroll will happen only when ng-repeat is rendered, all images are loaded and scrollAwesomeIndex is resolved.

<ul stz-scroll-into-view="scrollAwesomeIndex" stz-s-i-v-ng-repeat stz-s-i-v-img>
  <li ng-repeat="scroll in scrollAwesomeList track by $index" stz-s-i-v-ele="{{$index}}" stz-last-repeat>
    <img ng-src="placehold.it/8{{$index % 5}}0x6{{$index % 10}}0/8A8BA6/CACBF2/" stz-image-load alt="I think I deserve to be scrolled to!"/>
  </li>
</ul>