Hello, I'm trying to use jQuery EasySlider to carousel, however, when I specify a number in percentage for the width of the div container, the container fails to deliver content.
Am I to assume that it is incapable of dealing with percentages?
Hello, I'm trying to use jQuery EasySlider to carousel, however, when I specify a number in percentage for the width of the div container, the container fails to deliver content.
Am I to assume that it is incapable of dealing with percentages?
In EasySlider 1.7 It should work just fine. The relevant code in the plugin is:
var w = $("li", obj).width();
.width() in jQuery returns the value in pixels even if it is specified in the CSS as a percentage. Whether you specify percentage or pixels, it's effectively the same.
Which version of EasySlider are you using?
Use this ancient Math equation:
function getPercentage(percent, original)
{
return ((percent/100) * original))|0;
}
Customize the code as you want, It just gets the desired percentage of any number!.
Does the container div
have floating children? If true, that's why the div doesn't show any content (floating elements are taken out of the document flow and thus out of the parent element, which in turn will collapse to 0 width when there are no no-floating children).