Giter Site home page Giter Site logo

hadryan / jquery-image-auto-place Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eduardomb/jquery-image-auto-place

0.0 1.0 0.0 161 KB

jQuery plugin to re-arrange images among a text to provide a magazine like layout. For instance, the plugin can be configured to place the first image on the left side, the second on the right, the third on left, and so on.

HTML 100.00%

jquery-image-auto-place's Introduction

jQuery Image Auto Place

jQuery plugin to re-arrange images among a text to provide a magazine like layout. For instance, the plugin can be configured to place the first image on the left side, the second on the right, the third on left, and so on.

Usage Example

    <div id="content">
      <img style="width: 200px; height: 100px; border: 1px;" src="" alt="" />
      <img style="width: 200px; height: 100px; border: 1px;" src="" alt="" />
      <img style="width: 200px; height: 100px; border: 1px;" src="" alt="" />

      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean volutpat
      mi eget nisi sagittis ac auctor ligula feugiat. Nam congue molestie arcu
      at ornare. Aliquam dictum viverra eros, in laoreet ligula venenatis id.
      Maecenas quis lectus ac nibh mattis cursus. Duis iaculis scelerisque.
    </div>

    <script type="text/javascript">
      $('#content').imageAutoPlace(loopPattern: ['left', 'right']);
    </script>

The above example will rearrange the images to the following layout:

    |       | Lorem ipsum dolor
    | Image | sit amet, consect
    |       | etur adipiscing e
    lit. Aenean volutpat mi ege
    t nisi sagittis ac auctor l
    igula feugiat. Na |       |
    m congue molest i | Image |
    e arcu at ornare. |       |
    Aliquam dictum viverra eros
    in laoreet ligula venenatis
    |       | id. Maecenas quis
    | Image | lectus ac nibh ma
    |       | tisi cursus. Duis
    iaculis scelerisque.

Default Options

    {
      // Image padding
      padding: 10,

      // Minimum vertical space (px) btween images.
      offset: 200,

      // Minimum vertical space (px) before first image.
      initialOffset: 0,

      // Image selector. Ex: use 'img.foo' to only auto place imgs containing
      // class foo.
      imgSelector: 'img',

      // Ex: 'p'. Images will be placed btween chunks. If set to empty, the
      // element content will be converted to pure text (tags will be removed)
      // and each word will be a chunk.
      chunkSelector: '',

      // Images will be placed in this order. To only use left and right
      // images, use ['left', 'right'].
      loopPattern: ['center', 'left', 'right']
    }

jquery-image-auto-place's People

Contributors

eduardomb avatar tadeurahian avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.