Giter Club home page Giter Club logo

shuffle's People

Contributors

aecz avatar amirhosseinkarimi avatar dalexj avatar davidgallego avatar dependabot-preview[bot] avatar dependabot[bot] avatar greenkeeper[bot] avatar greenkeeperio-bot avatar larshp avatar macjohnny avatar schleuse avatar thirdender avatar vestride avatar ydah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shuffle's Issues

[SOLVED] Bootstrap 3 images grid

Hi,

I'm trying to use Shuffle.js since a few days but I can't get what I want...
I have several images with differents sizes and formats and want all of them organized in a grid...

Here is a JsFiddle of my attempt : http://jsfiddle.net/xd5Ns/embedded/result/

As you can see there is some vertical gap between images...

What I'm doing wrong ?

Pagination

This plugin looks awesome! But I'm looking a way to implement pagination. Is there an easy way to do this?

Issue with $ not being declared as global

Hi,

I used your plugin and found out that the plugin assumes that jQuery is set to $. This gave issues with my current config as jQuery is not bound to $.

I would suggest that the plugin uses the jQuery keyword instead of the $ as that is more common, with noconflict configs.

So window.jQuery instead of window.$. What do you think? Good suggestion / issue?

(function (factory) {
  if (typeof define === 'function' && define.amd) {
    define(['jquery', 'modernizr'], factory);
  } else {
    factory(window.jQuery, window.Modernizr);
  }
})(function($, Modernizr, undefined) {

Otherwise thanks for this, isotope runs slow and this seems to better take advantage of the css3 transforms and such.

Cheers!

Kenneth

uses this instead of $(this)

I just installed shuffle through bower, and I am loading it using requirejs.

I get the following error:

Uncaught TypeError: undefined is not a function jquery.shuffle.js:1211

The offending line reads: return this.each(function() {

Without reading anything else, I assume this should be return $(this).each(function() { correct? I am surprised I am the first to report this issue, so perhaps there is something else going on.

Turn off 3d Transforms

HI there,

I'm not sure if this is the right place to ask this question, but I wondered what I would need to do to turn of the 3d transforms.

I'm only using it as a filter. I'd like the results to just fade in and turn off the movement.

Is that possible?

Many thanks,

S

Active a button by default on page load ?

Hi,

I wonder if someone doesn't like to show all grids at fist view, but only the first category grids!
Is there a way to automatically active e.g. the first button on page load ?

Thanks for your awesome plugin

Quickly click on the filter buttons

Hi,
I found a small problem.
If quickly click on the filter buttons, the function is not working properly. This can be seen in your demo site.

_handleItemAnimationEnd : function( callback, item, willBeVisible, evt ) {
...
   if ( !willBeVisible ) {
      item.style.visibility = 'hidden';
    }
}

Is there any way to disable the masonry effect?

I have a grid of list items - some include longer text than others. My CSS uses floats and clears every 4th item. I'd prefer a consistent grid with some gaps where necessary, but shuffle.js enables a masonry effect which collapses the grid. Is there any way to disable this?

Many thanks.

opt.transition_delay for shuffle.transition()

I am replacing box content with fadeOut/fadeIn effect using shuffle.transition() with opt.opacity option.
Would be good to have an optional opt.transition_delay for shuffle.transition(), which sets the transition_delay on the element, restores option if the element is shuffle-item.

filtering causes crash of browsers in Ipad and Ipod

I used shuffle as a replacement for isotope in one of our theme, I noticed that it has been causing browser crash in ios devices only (ipad ,ipod and iphones). What might be the problem? Your help would be really appreciated.

Can i use multiple selector in one filter?

Hi Vestride,

Can i use multiple selector in one filter?

is work!

var target = "HTML5"
$xxx.shuffle( 'shuffle', target );

but, Is it possible to use multiple selector ?

target = "HTML5,Flash,Red"
target = "HTML5,Flash"
target = "['HTML5','Flash','Red']"
target = "HTML5 Flash Red"
target = ?

Thanks!

Is there a way to trigger 'layout.shuffle' manually?

Correct me if I am wrong. From what I've seen 'layout.shuffle' will only be triggered when 'shrink.shuffle' is triggered.

Is there a way to trigger 'layout.shuffle' manually even when 'shrink.shuffle' isn't triggered?

Thanks :)

don't work with ie < 9

If css transform support is not available opacity is used to hide elements, unfortunately opacity is supported in ie since 9.

One pixel gap between items

Hi,

First, congrats for your plugin !
I am having an weird issue, after I initilalize the plugins it adds a weird one pixel gap between my last set of thumbnails.

I've noticed that if I remove the vertical scrollbar from the browser with "overflow-y:hidden" then the gap disappear.This is happening just in Chrome, in Firefox works perfectly.
Any idea how can I fix this ?

I'm trying for hours to figure out how can I fix this...
Here is a link with a test page to see exactly what I'm trying to say.

Centered layout

Is it possible to make the columns centered inside main container?

Conflicts with protoaculous.1.9.0.min.js

Hi.

We use a template which needs protoaculous.1.9.0.min.js to be loaded - but unfortunately the shuffle isn't working with it. When clicking on a filter the whole content container gets a display:none.

Any ideas how to fix that? We already use "noconflict", but it doesn't help...

All works, when we do not load the protoaculous-lib - but unfortunately this is needed. ;o)

Update from 2.0.1: not working on load

When I update from 2.0.1 to 2.1.2, shuffle does not work properly: when I refresh the page all items are on the top left corner but if I resize the window or click on filters, any thumbnail goes to the right position. Here is the piece of code I am using in combination with waitForImages:

jQuery(document).ready(function ($) {

[other stuff...]

    var grid = $('.grid-items');

    function masonry() {

        grid.each(function () {

            var $this = $(this),
                filterOptions = $this.prev('.filter-options'),
                sizer = $this.find('.shuffle-sizer');

            $this.append(loader);

            $this.waitForImages({

                finished: function () {

                    $this.children('.landing-els').remove();

                    $this.shuffle({
                        itemSelector: '.item',
                        sizer: sizer,
                        speed: 500,
                        easing: 'ease-out'
                    });

                    if (filterOptions.length) {

                        var btns = filterOptions.children();
                        btns.on('click', function () {
                            var $this = $(this),
                                parentGrid = filterOptions.next(grid),
                                isActive = $this.hasClass('active'),
                                group = isActive ? 'all' : $this.data('group');

                            // Hide current label, show current label in title
                            if (!isActive) {
                                $('.filter-options .active').removeClass('active');
                            }

                            $this.toggleClass('active');

                            // Filter elements
                            parentGrid.shuffle('shuffle', group);
                        });

                        btns = null;

                    }

                    $this.removeClass('preload');
                    centerOverlay();

                },
                waitForAll: true
            });

        });

    }

    if (grid.length) {

        masonry();

    }

[other stuff...]

});

Any suggestion? Thanks ;)

When I modify the value of a data element, the sort uses the initial value.

I loaded a page with an element whose data value is 2072 and changed it to 2083. Then I went to sort, the breakpoint to get the data value in the sort function comes back as 2072 (unchanged). When I refresh the page, it then sorts correctly. How do I reload the values used for the sort without needing a page refresh?

question - hide all grid items on initial load

I'm trying to achieve two things with this script.

1] Set the initialSort to title but without having any dropdown menu for users to pick a sort order.
Ideally the sort should always be in alphabetical order of titles according to what I define in the data-title.
So I've added the option:
itemSelector: '.item_artists', // the selector for the items in the grid
initialSort: 'title' // make the grid show artist items in alphabetical order
But I'm not sure how to add a method to make this work, without having a dropdown menu list.

2] Make all the grid items hide on initially loading the page.
Ideally when first loading page, just the filter menu list will display, then once a menu list is clicked the grid items/images will show.
Is this possible to do with ease?

Thanks for this script, it's really useful and fast.

wordpress $.fn error

Hello, excuse me i've tried to create gallery with shuufle plugin. . at single page it works fine
but when i insert it into wordpress it .. browser console show me error messages about $.fn ... then i replace all $. entries to jQuery. in shuffle.js file
it will work

can i force work that without change shuffle plugin

PS. thats i insert to wordpress theme

wp_enqueue_script('jquery-shuffle', get_template_directory_uri().'/js/jquery.shuffle.js',array('jquery'));

wp_enqueue_script('js-gallery', get_template_directory_uri().'/js/gallery.js',array('jquery-shuffle')); -- it's my file(customized example ) somwhere i change $ too

Can I trigger a new sorting manually?

Hi,

I do some calculation on the body width where the items are placed inside.
Unfortunately your code gets executed before I've resized the body.

Can I trigger a new recalculation in shuffle manually?

e.g. $grid.shuffle('recalc')

Best, Gambo

Filtering + animated viewport

I've been toying around with the shuffle.js and the viewport script that comes with the package, but haven't been able to get the functionality working properly. Any idea how you'd get something like this setup with the current scripts? Filtering and adding '.in' on those filtered elements can be done easily, but reseting when 'all' is filtered is the tricky part Im running into. I feel like viewport needs to be reset or re-evaluate the current filtered items in the viewport. I thought shuffle('update) + viewport.refresh() would do the trick, but it didn't.

Any advice?

Shuffle and Accordion dont work correctly

Hello .. your script is absolutly great! I want use your demo-Script in combination with an simple Accordion-Script.

But the problem is that the itemSelector is "position:absolute" in your script and so my position:relative from the accordion script sont work!

If I overwrite the position:absolute it will be not correctly work.

Is there an option that I can temporary overweite the postion absolute in relative by clicking on the accordion or is there an optionen that the itemSelecor dont must be absolute?

My accordion are divs, that dont be inline or float. The divs are completly 100% width!

The Accordion-Script:
jQuery(document).ready(function(){
jQuery('.accordioncontentvk').hide();
var jQueryopenvk = jQuery();
jQuery('.accordionheadvk').click(function(e){
e.preventDefault();
jQueryopenvk.slideUp();
jQueryopenvk = jQuery(this).closest('div').find('.accordioncontentvk');
jQueryopenvk.not(':animated').slideToggle();
});
})

Thank You very much

Greetings Steffen

filtering not working in bootstrap 3

I'm trying to use this plugin with bootstrap 3 but after I click a filter button nothing happens.
I also get an JS console error : Uncaught TypeError: undefined is not a function and is pointing to these line: var debouncedLayout = $.throttle( 300, function() {....

The javascript code I used is the exact code from http://vestride.github.io/Shuffle/js/demos/homepage.js

This is the markup:

 <div class="container">
         <div class="filter-options btn-group">
          <button class="btn btn--warning active" data-group="wallpaper">Wallpapers</button>
          <button class="btn btn--warning" data-group="graphics">Graphic Design</button>
          <button class="btn btn--warning" data-group="photography">Photos</button>
          <button class="btn btn--warning" data-group="3d">3D Renders</button>
        </div>
        <div id="grid" class="row">



        <figure class="col-sm-4 picture-item" data-groups='["photography"]'>
        <img class="img-responsive" src="http://placehold.it/400x300" alt="img01"/>
        <figcaption>
            <h2>Nice <span>Lily</span></h2>
            <p>Lily likes to play with crayons and pencils</p>
            <a href="#">View more</a>
        </figcaption>         
    </figure>

     <figure class="col-sm-4 picture-item" data-groups='["photography"]'>
        <img class="img-responsive" src="http://placehold.it/400x300" alt="img01"/>
        <figcaption>
            <h2>Nice <span>Lily</span></h2>
            <p>Lily likes to play with crayons and pencils</p>
            <a href="#">View more</a>
        </figcaption>         
    </figure>


     <figure class="col-sm-4 picture-item">
        <img class="img-responsive" src="http://placehold.it/400x300" alt="img01"/>
        <figcaption>
            <h2>Nice <span>Lily</span></h2>
            <p>Lily likes to play with crayons and pencils</p>
            <a href="#">View more</a>
        </figcaption>         
    </figure>

         <div class="col-sm-4 shuffle__sizer"></div>   

Here is a jsfiddle with all the code. The same error...

IE8, shuffle places all items in top left.

Hi,

Why might I have to destroy and enable shuffle in IE8 after it's initial setting in order to get it to layout properly?

    var shuffleItems = $(".boxes"), shuffleSizer = shuffleItems.find('.shuffle-sizer');

    shuffleItems.shuffle({
      itemSelector: '.box',
      sizer: shuffleSizer,
      gutterWidth: 0
    });

    if(ie==8) {
      setTimeout(function () {
        shuffleItems.shuffle('destroy').shuffle();
      }, 100);
    }

This works, but obviously results in a small flash of the bootstrap grid, smushed into the corner, then laid out properly. IE9 is unaffected.

Deep linking to filters

I was wondering if there was anyway to deep link into a page that has a Shuffle grid to a specific filter.

i.e. from home page click on a submenu for Wallpaper and link into the shuffle page and have only the wallpapers showing?

Thanks!

Don't limit opts.callback in transition() complete()

Right now opt.callback is limited only for opts.from === 'layout' and opts.from === 'shrink'.
I am using opt.from optionally to describe my action, but I would like to do some actions after the transitions end.

$grid.shuffle.transition({
    from: 'fadeOut',
    $this: $current,
    opacity: 0,
    callback: appShuffle.testCallback
})

// Example:
$grid.shuffle.transition({
    from: 'fadeOut',
    $this: $current,
    opacity: 0,
    callback: function() {
        $grid.shuffle.transition({
            from: 'fadeIn',
            $this: $current.html($(box).html()),
            opacity: 1
        });
    }
})

Are layoutTransitionEnded and callback.call() limited intentionally?

// Changes - move callback.call outside if {}
complete = function() {
    if (!self.layoutTransitionEnded && opts.from === 'layout') {
        self._fire(Shuffle.EventType.LAYOUT);
        // 
       // opts.callback.call(self);
        self.layoutTransitionEnded = true;
    } else if (!self.shrinkTransitionEnded && opts.from === 'shrink') {
        self.shrinkTransitionEnded = true;
        // 
       // opts.callback.call(self);
    }
    // This is the new line
    opts.callback.call(self);
};

Adding dynamically items and trigger shuffle

Hi,

I add dynamically items from ajax.But my item's transfrom style is not updated ( webkit-transform: translate3d(0px, 0px, 0px)).

How can I update item's inline style and trigger shuffle ?

Thanks.

hidden elements on top of visibile ones

On ie9 i have hidden elements on top of visible ones, wouldn't make sense to play with z-index or set them display: none to avoid this kind of issues? On decent browsers of course it works fine :)

Bower and version without Modernizr?

Hi Glen. I am just looking into your plugin and really like it.

Have you thought about adding bower.json and a version without Modernizr for easier workflow?

TypeError on minified version

I found this error TypeError: b.prefixed is not a function on minified version, error occur when the jquery.shuffle.min.js is included in the script

Images and margins

Hi there!

What a nice work you've done. First of all, thank you!

Second, I've been trying to put the images close together, without a gap between them. Is that possible?

Thank you and best regards,

Jullie

Page Height Not Resizing After Filtering

Hi Glen,

I replaced my previous implementation of Isotope with Shuffle.js because the better performance of the latter. Everything has been working great except for one small issue.

The problem is that the height of the page does not adapt to the reduced height of the #grid container after filtering, making the body extend below the footer:

page height not resizing

As I did have this problem with Isotope I don't think its a problem with the CSS. However, I am not a web developer, and I might be wrong of course.

Any suggestions that might point me into the right direction are highly welcome!

Cheers,

Stefan

v3.0.0 cuts last element before moving it to the next row

Everything works beautifully in 2.1.1. I'm testing by using the same layout, same JS code and just switching between release 3.0.0 and 2.1.1:

$('.properties-listing-container').shuffle({
itemSelector: '.property-listing',
columnWidth: 300,
gutterWidth: 20
});

Container is a div with article-elements inside. Article has fixed width of 300px.

v2.1.1 works correctly:
v2 1 1

v3.0.0 won't update until around 1160px container width, which results in cutting the last element. Also note the behaviour on second line.
v3 0 0

Same thing happens in FF (33) and Chrome on Ubuntu 14.04. Also witnessed on Mac by other devs in my team.

Pageload issues in Firefox 20.0.1

Hi there,

When you load the example page (http://vestride.github.io/Shuffle/) in the latest version of Firefox it sometimes doesn't load correctly, like so:

image

I've noted three things about this behavior so far you might find useful:

  1. When it doesn't work on page load, clicking a toggle filter or sort button will trigger the grid elements into place.
  2. It will sometimes work on page load if you keep refreshing the page.
  3. The dates features on the grid element images shoot to the upper right of the window when it doesn't work (as seen in the image above)

bootstrap v3 - grid position above each other

The javascript lib is not compatible with bootstrap v3.
Using following code the grids are positioned above each other.

jQuery(document).ready(function() {
  var $grid = jQuery('.row'),
      $sizer = $grid.find('.shuffle__sizer');

  $grid.shuffle({
    itemSelector: '.post-grid', //<div class="post-grid col-xs-12 col-sm-6 col-md-4 col-lg-4">
    sizer: $sizer
  });
});

Regards,
Ninos

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.