1000px width div target #74

Closed
sjanofsky opened this Issue May 31, 2012 · 2 comments

Projects

None yet

3 participants

@sjanofsky

When the target is a 1000px wide div, the browser shows a horizontal scroll bar when spin() is called. If the div width is < 1000px, then the horizontal scroll bar is not shown.

Is there something in the spin code that is sizing a hidden div or frame or something?

@riddla
riddla commented Jun 6, 2012

The following hotfix worked for me:

// sets the width of the spin element according to the generated canvas elements
var spin_element = $('.spinner');
if (spin_element.length) {
    total_width = 0;
    spin_element.find('div').each(function() {
        total_width += $(this).outerWidth();
    });
    spin_element.css('width', total_width);
}

(Probably needs some refinement / check for canvas element existence etc.)

@sjanofsky

Worked perfectly... thanks!

On Wed, Jun 6, 2012 at 9:13 AM, riddla wrote:

The following hotfix worked for me:

// sets the width of the spin element according to the generated 
canvas elements
var spin_element = $('.spinner');
if (spin_element.length) {
  total_width = 0;
  spin_element.find('div').each(function() {
      total_width += $(this).outerWidth();
  });
  spin_element.css('width', total_width);
}

(Probably needs some refinement / check for canvas element existence
etc.)


Reply to this email directly or view it on GitHub:
#74 (comment)

@fgnass fgnass added a commit that closed this issue Aug 10, 2012
@fgnass Set width to zero. Fixes #74 e3d09ff
@fgnass fgnass closed this in e3d09ff Aug 10, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment