Code Monkey home page Code Monkey logo

gridheist's People

Contributors

cavis avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

gridheist's Issues

Dynamic Resizing for Responsive Design

Could the plugin adapt to various devices? My thoughts are

  1. Height reacts when the window narrows
  2. There's an option to hide arrows on mobile devices

This would be helpful for when you've uploaded images of the same height (in my case 650px) but the size of the device makes it so the image has to be less tall because it can't fit width wise.

Add jQuery min-width variable

Would be awesome to specify either a pixel width or percentage of original that would limit how skinny a thumb could get.

Your Image Could Not Be Loaded // AngularJS

Hey.

Trying to implement this plugin in an Angular project. It loads successfully but even within doc.ready closure it throws the error:

 GridHeist.prototype.getDimensions = function($img, callback) {
    var h, tmp, w;
    if ((w = $img.data('width')) && (h = $img.data('height'))) {
      return callback(w, h);
    } else {
      tmp = new Image();
      return $(tmp).load(function() {
        $img.data('width', tmp.width);
        $img.data('height', tmp.height);
        return callback(tmp.width, tmp.height);
      }).error(function() {
        <------ Throws this error every time ----->
        console.error('An error occurred and your image could not be loaded.  Please try again.');
        return callback(100, 100);
      }).attr({
        src: $img.attr('src')
      });
    }
  };

Any ideas?

Edit: Angular layout...

<div class="image_grid" ng-show="gallery.images">
        <a href ng-repeat="image in gallery.images">
            <img src="/{{ image.location_of_original_file + '600x400/' + image.filename }}" >
        </a>
    </div>

Edit again: JS at the bottom of the page

$(document).ready(function() {

    // gridheist the images
    var options = {
        thumbBorder:      10,
        thumbMinHeight:   10,
        thumbMinWidth:    100,
        thumbMaxHeight:   400,
        expander:         false
    };

    $('.image_grid').gridHeist(options);

Edit I swear to God the last time: even if I place data-height and data-width images it doesn't actually appear to be changing the layout, they just have the height and width css properties set now.

<div class="image_grid" ng-show="gallery.images">
        <a href ng-repeat="image in gallery.images">
            <img src="/{{ image.location_of_original_file + '600x400/' + image.filename }}" data-height="300" data-width="400">
        </a>
    </div>

Feature: Add Lazy Loading

When using the jQuery lazyloading GH has a hard time working with the placeholder image. Unless I'm doing it wrong. Here's the code

var options = {
            thumbBorder:      10,
            thumbMinHeight:   10,
            thumbMinWidth:    100,
            thumbMaxHeight:   {{ Settings::getSetting('thumbnail_height') }},
            expander:         false
        };

        $('.gallery').gridHeist(options);
            $(".lazy").lazyload({
            event: "scrollstop",
            threshold: '200',
            load : function()
            {
              $('.gallery').gridHeist('update'); 
             }
       });

And the HTML:

<li>
<a href="http://app.nationalmachine.co/users/1/galleries/2/2/ElizabethAndJarett0045.JPG" data-uid="70">
<img class="lazy" data-original="http://app.nationalmachine.co/users/1/galleries/2/2/thumbs/ElizabethAndJarett0045.JPG" src="http://app.nationalmachine.co/images/placeholder.jpg" width="450" height="300">
</a>
</li>


Preloader Function

Would be awesome to be able to define load x number of images in front of active image, load x number behind active image.

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.