hi,

I have created a slideshow with 2 picture. First, the preview under view sometimes not working correctly. 2nd, under Chrome, sometimes it work, sometimes it don't. Browse to other website and come back sometimes can work and click refresh may make it don't.

I have tested on IE7, Firefox and Chrome and only Chrome give me this problem so I "inspect the element" go into CSS and found out something is wrong.

See the different between WORKING and FAULTY as when the slideshow is working, all the coordinate, width and height contain value, but when it's not working, all the coordinate, width and height has 0 value.

Has anyone experience the same issue?

CommentFileSizeAuthor
#9 chrome_not_display-1191534-9.patch935 bytesckng
#7 1191534.patch544 bytesromeo404
FAULTY340.7 KBmaxchock
WORKING310.4 KBmaxchock

Comments

maxchock’s picture

Title: Random mode not working under Chrome. » Sometimes not working under Chrome.

I double checked, it work randomly no matter which transition mode i choose.

rhazor’s picture

Hello. My problem was: Default Nivo Slider settings, IE8 and FF works fine, but when you go with Chrome, there is nothing in sliders place, its just plain empty area. Anyway the slider is enabled, because with Firebug you can see the code.

Interesting: Lets say my slider is in a home page. When I visit my page, no slider. Then lets say I click some link like Contact, go to Contact page and then click back button in your Chrome browser and slider will appear working. If you refresh, its all gone again.

So, my solution is: You need to set correct width and height in your .css (I use my custom themes styles.css in themes folder). An example:

#views-jqfx-nivo-slider-images-1 {
	height: 228px !important; /* height of your images shown in a slider */
	width: 678px !important; /* width of your images shown in a slider */
}

That fixed my problem.

Tools used: views_nivo_slider-7.x-2.x-dev.zip, views_jqfx.tar.gz, nivo-slider2.5.2.zip (plugin from official Nivo Slider website, this must be unpacked into the sites/all/libraries folder)

maxchock’s picture

Ya, your problem is same as mine. I think is becoz chrome handle image different from IE and Firefox? If your way can fix the problem means that the CSS can't get the dimension of the image??

Can someone plz come out with a better fix rather than a hack?

classicwinters’s picture

Priority: Critical » Normal

Hello I've been trying to get this working on 7.2x can you give me a slightly detailed steps for creating the views and content types for this? I've been running into problem after problem. Thanks

melissa81’s picture

Its been 3 months since the last dev update. Hope this get stable soon.

-Mel.

maxchock’s picture

I guess this project is not under very active development. View Slideshow is more active but is not easy to use.

romeo404’s picture

StatusFileSize
new544 bytes

my solution but it will cause some trouble with ajax after that

kaylsbeth’s picture

I found going into modules > views_nivo_slider > styles > default, opening custom-nivo-slider.css, and putting in the height and width of my pictures under .nivoSlider img did the trick. I haven't seen any cross-browser compatibility issues, and it pleases chrome.

I'm not sure if I'm breaking some sort of rule by directly editing the css within the module files, but it worked.

ckng’s picture

StatusFileSize
new935 bytes

This should be related to image dimension not generated, see http://drupal.org/node/908282#comment-3482664
Also keep an eye out for #1129642: Populate HTML image tags with dimension attributes (like D6 imagefield) without re-introducing I/O

Please try out this patch to see if there are any problem.

ckng’s picture

Status: Active » Needs review
ckng’s picture

Title: Sometimes not working under Chrome. » Not working under Webkit (Chrome/Safari) on first load
caschbre’s picture

I applied the patch in #9 and so far i haven't experienced this issue anymore in chrome.

altavis’s picture

@#9

I'm glad to confirm that this issue is solved. Works in FF3.6, Chromium and Opera.

tomas_fenix’s picture

Applied patch #9 and all it did was extend the width to 100% of container, did not expand height.

ckng’s picture

Patch #9 only added 1 line of code to ensure the page is loaded before getting the image size, which is how webkit works.
If you are getting 100% likely indicates you've set it in your CSS or style somewhere.

Screenack’s picture

#2 worked, as I expected, as did #9; but #9 seems to be the "correct" solution? Using #9; thanks! (Update: I continue to need both, as elements below the slider don't push down as they need to to display correctly.)

bryancasler’s picture

subscribe

rma4ok’s picture

Priority: Normal » Critical

to patch today

(function ($) {

  Drupal.behaviors.views_nivo_sliderBehavior = {
    attach: function (context) {
      $('.views-nivo-slider:not(.nivo-slider-processed)', context).each(function() {
        var vns = $(this),
            id = vns.attr('id'),
            cfg = Drupal.settings.views_nivo_slider[id],
            imgs = $('img', vns),
            imgLoadsCount = 0;

        function processImage(img) {
          var hmax = (vns.data('hmax') > img.height()) ? vns.data('hmax') : img.height(),
              wmax = (vns.data('wmax') > img.width()) ? vns.data('wmax') : img.width();

          vns.width(wmax).height(hmax).data('hmax', hmax).data('wmax', wmax);
          if (++imgLoadsCount == imgs.length) vns.nivoSlider(cfg); //when all images done 
        }

        // Fix sizes
        vns.data('hmax', 0).data('wmax', 0);

        imgs.each(function() {
          var img = $(this);
          if (img.height() == 0) img.load(function() {processImage($(this));}); //if image is not ready yet (Crome's js even faster then image loading)
          if (img.height() > 0) processImage(img); //if js slooower then image loading (IE is a booger)
        });

      })
          .addClass('nivo-slider-processed');
    }
  };

})(jQuery);

Boss! Push beta release!

patoshi’s picture

sub

ron williams’s picture

#18 works for me.

vdupom’s picture

#18 works for me too

d.cox’s picture

sub

ckng’s picture

Priority: Critical » Normal
Status: Needs review » Fixed

Committed patch in #9: 463e12f

ckng’s picture

Version: 7.x-2.x-dev » 6.x-2.x-dev
Status: Fixed » Patch (to be ported)
ckng’s picture

Status: Patch (to be ported) » Fixed

Committed to 6.x-2.x-dev branch

Status: Fixed » Closed (fixed)

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