Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style attribute cleared after transition #1

Open
janmentzel opened this issue Jun 17, 2011 · 0 comments
Open

style attribute cleared after transition #1

janmentzel opened this issue Jun 17, 2011 · 0 comments

Comments

@janmentzel
Copy link

If you have a tag having a non-empty style attribute the style attribute will be empty after transition.

Right now addTransitionClass() and addTransitionClass() behave like this:
before: <div style="color:blue; font-weight:bold;">...</div>
transition
after: <div style="">...</div>

Expected behaviour:
before: <div style="color:blue; font-weight:bold;">...</div>
transition
after: <div style="color:blue; font-weight:bold;">...</div>

For me the following patch did it (includes test case as well):

diff --git a/jquery.transitions.js b/jquery.transitions.js
index b6f3e9c..ae08973 100644
--- a/jquery.transitions.js
+++ b/jquery.transitions.js
@@ -232,7 +232,7 @@

                        elem
                        .unbind(jQuery.support.cssTransitionEnd, end)
-                       .bind(jQuery.support.cssTransitionEnd, { obj: elem, callback: options && options.callback, properties: properties }, end);
+                       .bind(jQuery.support.cssTransitionEnd, { obj: elem, style: style, callback: options && options.callback, properties: properties }, end
                }
                // Check to see if children have transitions. This is just a
                // sanity check. It is not foolproof, because nodes could have
diff --git a/test/index.html b/test/index.html
index 4a9e2f8..13f217f 100644
--- a/test/index.html
+++ b/test/index.html
@@ -231,6 +231,12 @@
                </div>
        </section>

+       <h2>transition with style attribute set</h2>
+       <section class="no2_test test">
+               <p>Click me.</p>
+               <div class="expand" style="color:blue; font-weight:bold;">text should be bold and blue!</div>
+       </section>
+       
        <h2>No transition</h2>

        <section class="test">

Regards, Jan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant