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

imxquery

v2.0.0

Published

Helper module to provide some basic convenience methods

Downloads

67

Readme

imxQuery

A small helper module to provide convinience methods

Who is this for?

If you one of those jQuery users who only use this framework for some convinience methods and totaly aware of the fact that there is no need to use jQuery only for creating selectors, than imxQuery might come in handy.

Installing

Currently there is only one way to install the CSS3Slider, using NPM:

$ npm install imxquery

After this you can simply require imxQuery:

var imxQuery = require('imxquery');

Accessing imxQuery

imxQuery down to the base, is a simple VanilaJS module. You can access it through several public methds:

offsetTop

offsetTop will return you the top offset of a given node relative to the body

imxQuery.offsetTop(htmlNode);

offsetLeft

offsetTop will return you the left offset of a given node relative to the body

imxQuery.offsetLeft(htmlNode);

scrollTo

scrollTo will scroll the window to a specific position.

imxQuery.scrollTo(xPosition, yPosition, duration);

The params

  • xPosition - target position on the x-axis
  • yPosition - target position on the y-axis
  • duration - amount of time it shall need, for the scroll to perform

Tip

In order to scroll to a specific node on the page, you can combine the offset methods with the scroll method:

imxQuery.scrollTo(0, imxQuery.offsetTop(htmlNode), 100);

scrollElementTo

The same as scrollTo, but scrolls inside an element.

imxQuery.scrollElementTo(xPosition, yPosition, duration, targetNode);
  • targetNode - the htmlNode that you want to scroll

accessDataset

A handy small wrapper method to read out data attributes

<article id="myTestArticle" data-info_latitude="54.756">
imxQuery.accessDataset(document.getElementById('myTestArticle'), 'info_latitude');

extendObject

Extend an object with another object, adding missing fields

var baseObject = {
  title : 'title text',
  text : 'a lot of text'
};

var configObject = {
  lat : '54.765',
  lng : '7.897'
};

imxQuery.extendObject(baseObject, configObject);

This will result in:

var baseObject = {
  title : 'title text',
  text : 'a lot of text',
  lat : '54.765',
  lng : '7.897'
};

documentReady

Wait for the document to be loaded completly, to perform a callBack function.

imxQuery.documentReady(function(){
  alert('document is loaded');
});