nifkuza / gwtquery

Automatically exported from code.google.com/p/gwtquery
MIT License
0 stars 0 forks source link

sliding animation covers elements underneath #60

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
<div id="foo" style="width: 60px;">Enough text to cause wrapping within the div 
tag.</div>
<div style="background-color: red; width: 100px; height: 100px; padding: 
10px;">Animation should not touch this area</div>
2. $("#foo").as(Effects).slideToggle(2000, null);
3.

What is the expected output? What do you see instead?
After toggling, the first div should be restored to its original position. 
Instead, it overlaps with the second div.

What version of the product are you using? On what operating system?
gwtquery-1.0.0-SNAPSHOT.jar Nov 5th
Chrome 7.0.517.44
Mac OS X 10.6.4

Please provide any additional information below.

Original issue reported on code.google.com by kristof....@gmail.com on 5 Nov 2010 at 12:51

GoogleCodeExporter commented 9 years ago
Hi Kristof,
As I said in issue 63, there is a bug in slide* methods. 

In waiting the fix in GQuery, implement the slideToogle by this way :

  public void slideToogle(String selector, int millisec) {
    final GQuery query = $(selector);
    if ("none".equals(query.css("display"))) {
      String height = "" + query.data("initialHeight") + "px";
      query.as(Effects).animate("height: '" + height + "'", millisec,
          new Function() {
            @Override
            public void f() {
              query.show().height(null);
            }
          });
    } else {
      query.data("initialHeight", GQUtils.cur(query.get(0), "height", true));
      query.as(Effects).animate("height: '0px'", millisec, new Function() {
        @Override
        public void f() {
          query.hide();
        }
      });
    }
  }

...

slideToogle("#foo", 2000);

Julien

Original comment by julien.d...@gmail.com on 5 Jan 2011 at 9:52

GoogleCodeExporter commented 9 years ago

Original comment by julien.d...@gmail.com on 15 Jan 2011 at 6:42

GoogleCodeExporter commented 9 years ago

Original comment by julien.d...@gmail.com on 15 Jan 2011 at 6:43

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
fixed in r330 Use last snapshot
Thanks for the reporting

Original comment by julien.d...@gmail.com on 21 Jan 2011 at 3:42