When images are first uploaded and are being called by imagecache, the fluidgrid views seem to place all the images on top of each other. The heights only seem to work once the page is then refreshed..

Is this standard or am I the only one experiencing this? Seems to happen on all my sites using this module, and I imagine some site users would find it confusing.

Comments

stoatoffear’s picture

StatusFileSize
new419.7 KB

Mine too!

erfunath’s picture

Has anyone come up with a solution to this? My images are stacking properly on Firefox, but Chrome/Safari are piling up vertically like in the image posted above by stoatoffear.

iaminawe’s picture

I am experiencing the same.

I think it may have to do with this http://masonry.desandro.com/docs/intro.html#imagesloaded_plugin

I should mention I am using the D7 version and other than this it works great.

Any thoughts?

Marko B’s picture

StatusFileSize
new309.17 KB

I am having the same problem, even this doesnt help.
http://drupal.org/node/1113602 in Chrome i keep getting images stacked one over the other as in attachment.

technikh’s picture

I am having same issue. ie, safari, chrome all show stacked images when I press F5(Refresh) but when I press enter key in address bar the page looks good with unstacked images.
Firefox version 8 shows unstacked images all the time

technikh’s picture

Category: support » bug
Priority: Normal » Major

marking as bug

technikh’s picture

even though I enable the below option, it's not fixing this issue
Reload items on window load
Call the reload method on $(window).load(), this helps to deal with external media such as images or @font-face kits.

I am using the D7 version at http://drupal.org/node/1031402#comment-4890184

technikh’s picture

I fixed it by adding imagesLoaded functionality as suggested by iaminawe http://masonry.desandro.com/docs/intro.html#imagesloaded_plugin

.imagesLoaded( function(){

in init.js

$this
.addClass('views-fluidgrid-processed')
.imagesLoaded( function(){
	$this.masonry({
	columnWidth: settings.columnWidth != '' ? parseInt(settings.columnWidth) : undefined,
	gutterWidth: settings.gutterWidth != '' ? parseInt(settings.gutterWidth) : undefined,
	isResizable: settings.resizable,
	isRTL: settings.rtl,
	isFitWidth: settings.fitWidth,
	isAnimated: true && settings.animationOptions.useCss ? !Modernizr.csstransitions : settings.animate,
	animationOptions: {
		duration: parseInt(settings.animationOptions.duration),
		queue: settings.animationOptions.queue
	},
	itemSelector: '.views-fluidgrid-item:visible'
});
});
technikh’s picture

Status: Active » Needs review

Changing status to needs review

Marko B’s picture

TechNikh could you post this also for D6 version, i am not good with jquery so i could transform this to be comaptible with d6 JS code.

technikh’s picture

I didn't test it it, but the above code should work for D6 version too.

Marko B’s picture

Ok but where to even put it? there is no init.js in D6 version. I'll test if I can install this code properly, please help on this part

technikh’s picture

I guess in views_fluidgrid.module put "imagesLoaded" before

        $('#".$vars['views_fluidgrid_id']."').masonry({
          singleMode: viewsFluidGrid.".$vars['views_fluidgrid_id'].".settings.single_mode,
          columnWidth: viewsFluidGrid.".$vars['views_fluidgrid_id'].".settings.column_width,
          itemSelector: '.views-fluidgrid-item:visible',
          resizeable: viewsFluidGrid.".$vars['views_fluidgrid_id'].".settings.resizeable,
          appendedContent: $('#".$vars['views_fluidgrid_id']."'),
          saveOptions: false
          },  function() { eval(viewsFluidGrid.".$vars['views_fluidgrid_id'].".settings.callback); }
        );
Marko B’s picture

Hmmm there is no such code in "views_fluidgrid.module" but i guess you ment to put imageloaded somehow in part where masonry is configured?

technikh’s picture

I don't remember where I saw that, but Yes! put imageloaded in part where masonry is configured

Marko B’s picture

First of, you need to upload a file "jquery.imagesloaded.min.js" somewhere and add it to drupal. Then add its path in views_fluidgrid.module somewhere here

function template_preprocess_views_view_fluidgrid(&$vars) {
  $view = $vars['view'];
  $options = $view->style_plugin->options;
  
  drupal_add_js(drupal_get_path('module', 'views_fluidgrid') .'/js/jquery.masonry.min.js');
  drupal_add_css(drupal_get_path('module', 'views_fluidgrid') .'/views_fluidgrid.css');

like
  drupal_add_js(drupal_get_path('module', 'views_fluidgrid') .'/js/jquery.imagesloaded.min.js');

then add settings somewhere think around the comment that says "this looks like shit" :-)

Marko B’s picture

Status: Needs review » Fixed

Here is complete solution for drupal 6, http://www.drupaldump.com/views-fluid-grid-jquery-masonry-fix-images

Works great and as it should, asking maintainer to update this module :-)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

giorgio79’s picture

Version: 6.x-1.3 » 7.x-1.x-dev
Status: Closed (fixed) » Patch (to be ported)

I am seeing this n 7x dev. A fix would be great in the module code, not in a blog :)

zilla’s picture

i think that this should be marked RTBC and moved into the dev version of this module for D7 and 6, and perhaps as a prep for a D7 alpha of some kind (not sure what the roadmap is for this module, though it seems quite popular)

arturs.v’s picture

Issue summary: View changes
StatusFileSize
new1.79 KB

Created a quick patch from comment #8

sjancich’s picture

Patch in #21 works for me.