Changeset 289 in t29-www for shared/js-v6
- Timestamp:
- Aug 16, 2012, 8:03:29 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
shared/js-v6/modules/menu.js
r279 r289 343 343 bwidth = $(".bullet",g).outerWidth(); 344 344 each_width = (g.width() + bwidth*2) / count; 345 a.width(Math.floor(each_width)); 345 each_width = g.width() / count; 346 347 348 // problem: each_width = 16.384023... -> Math.floor liefert zu schmale Werte, direktes 349 // a.width(each_width) hingegen kann mit Fliesskomma nicht umgehen. Daher jetzt ein Ansatz, 350 // CSS3-Subpixelwerte mit ueberschaubar vielen Dezimalstellen anzuwenden. 351 roundNumber = function(num,dec) { return Math.round(num*Math.pow(10,dec))/Math.pow(10,dec); }; 352 subpixel_width = roundNumber(each_width, 2); 353 a.css("width", subpixel_width+"px"); 354 //a.css("width", Math.floor(each_width)+"px"); 346 355 // text-Label zentriert darstellen um den Punkt 347 356 $(".text", a).css("left", function(){return(bwidth - $(this).width())/2; });
Note: See TracChangeset
for help on using the changeset viewer.