Rotate on click css card flip
# March 4, 2013 at 5:24 pm
Hey man, im unsure if you want the card to flip back with either a second click & mouse leave, or both. I forked your fiddle into a codepen so check it out and tell me if that is what you wanted. But to answer your initial question, we just need to bind multiple events using the
bind()method and a little
References:# March 5, 2013 at 9:38 pm
What i suggest to try
Did you add a link to jquery? Is it the ‘latest’ jquery? (try different release versions)? Inspect element to see if you get any console errors As of late though, with the latest jQuery version 1.9.1, toggle has been acting very strange. In most instances it will hide the element almost immediately. I revisited that code and i will make some improvements, but basically to attach two events just use bind(). Let us know how it turns out on your MacOS ML. Ill shoot you a improved pen shortly.
Good to hear. Better yet, instead of using .ready( ), why not just use an anonymous function?
I got an EXAMPLE here. There are more ways to do it but i’ve forgotten, feel free to add.# March 5, 2013 at 10:10 pm
I’ll look into that!
I have tested it with different version of jquery and I can confirm that with 1.9.1 and toggle, it disappears, everything below that works fine for me..
Also on a side note: quite happy with the current solution but if you’re up for it:
How would you code it, so that the card only flips on state2 (back) using mouseleave and click? So that it would NOT flip on state 1 (front) using mouseleave. The only option to flip state1 should be via click…
Thanks for your help, I appreciate it a lot!
You must be logged in to reply to this topic.