fonction Animate and percentage (%) bug ?

fonction Animate and percentage (%) bug ?

Hello people, I'm currently stacked on a bug while using animate in percentage :(

I already checked this post http://forum.jquery.com/topic/jquery-animate-percentage but noone replied :(

I tried with the last JQuery library (1.4.2) but without success ...
That's was tried on google Chrome, Firefox and Internet explorer.
The float was really toggle only with Chrome and the width is always interpreted in pixel, not in percentage on all browsers tested.

So if anyone know of fix it ^^

Here is the query I'm trying to use :


  1. <script type="text/javascript">
  2. $(document).ready(function() {

  3. var sidebar = $("#sidebar");
  4. var main = $("#main");

  5. $('#bouton').toggle(
  6. function()
  7. {
  8. sidebar.animate({
  9. width: "toggle",
  10. opacity: "toggle"
  11. }, "slow"),
  12. main.animate({
  13. float: "left",
  14. width: "100%",
  15. // width: ($('#main').width()*1.0),
  16. }, "slow");
  17. function() {
  18. sidebar.animate({
  19. width: "toggle",
  20. opacity: "toggle"
  21. }, "slow"),
  22. main.animate({
  23. float: "right",
  24. width: "70%",
  25. // width: ($('main').width()*.70),
  26. }, "slow");
  27. }
  28. );
  29.    return false;
  30. });
  31. </script>

    • Topic Participants

    • wolwx