第二次单击时jquery反向动画(jquery reverse animation on second click)
我想在第二次点击时有一个反向动画,但第二个动画必须与第一个相反,但必须有相同的动画。 我也在jquery写道,因为我希望在点击后对象保持在该位置,直到我再次点击。
我希望你明白我的意思。 万分感谢!
JavaScript的:
$('.linguait').click(function() { if (('.linguait').hasClass('active')) { $('.linguait').removeClass('active'); $('.linguait').addClass('deactive'); } else{ $('.linguait').removeClass('deactive'); $('.linguait').addClass('active'); } });
CSS:
linguait.active { right:25%; margin-right: -10px; -webkit-transform: rotate(360deg); transform: rotate(360deg); -webkit-transition: right 2s, margin-right 2s, -webkit-transform 2s; transition: right 2s, margin-right 2s, transform 2s; } .linguait.deactive { right:5%; margin-right: -2px; -webkit-transform: rotate(360deg); transform: rotate(360deg); -webkit-transition: right 2s, margin-right 2s, -webkit-transform 2s; transition: right 2s, margin-right 2s, transform 2s; }
I would like to have a reverse animation on second click, but the second animation must be the opposite of the first but must have the same moviments. I wrote also in jquery because I want that after click the object stays in the position until I click again.
I hope you understand what I mean. Thank you a lot!
JavaScript:
$('.linguait').click(function() { if (('.linguait').hasClass('active')) { $('.linguait').removeClass('active'); $('.linguait').addClass('deactive'); } else{ $('.linguait').removeClass('deactive'); $('.linguait').addClass('active'); } });
CSS:
linguait.active { right:25%; margin-right: -10px; -webkit-transform: rotate(360deg); transform: rotate(360deg); -webkit-transition: right 2s, margin-right 2s, -webkit-transform 2s; transition: right 2s, margin-right 2s, transform 2s; } .linguait.deactive { right:5%; margin-right: -2px; -webkit-transform: rotate(360deg); transform: rotate(360deg); -webkit-transition: right 2s, margin-right 2s, -webkit-transform 2s; transition: right 2s, margin-right 2s, transform 2s; }
原文:https://stackoverflow.com/questions/34903414
最满意答案
使用Vim开发iOS或Mac可以真正强大而快速,特别是如果您使用TDD或需要快速反馈。
但是需要一点点才能使它工作。 你需要知道的几件重要的事情是:
- 使用
xcodebuild
命令行工具从一些vimscript运行你的构建和单位。- 使用
clang_complete
插件可以在vim内给你完整的代码完成。- 使用
ios.vim
和cocoa.vim
插件进行导航。这是我首选的工作方法。 事实上,我写了
ios.vim
插件,使更容易为更多的人。Developing for iOS or Mac with Vim can be really powerful and fast, especially if you use TDD or want quick feedback.
But it takes a bit of finagling to get it working. The few important things you need to know are:
- Use the
xcodebuild
command-line tool to run your build and units from some vimscript.- Use the
clang_complete
plugin to give you full code completion from within vim.- Use the
ios.vim
andcocoa.vim
plugins for navigation.This is my preferred method of working. In fact, I wrote the
ios.vim
plugin to make this easier for more people.
相关问答
更多-
红帽linux下文本编辑的命令是什么?[2022-08-28]
vim -
看起来好像您将以前安装的Xcode的相关SDK链接到Xcode 6 Beta目录,Xcode 6将能够使用它。 假设您的计算机上仍然有Xcode 5.1.1,请在终端中尝试以下操作: ln -s /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk /Applications/Xcode6-Beta.app/Contents/Developer/Platfor ...
-
与苹果开发者论坛上非常有帮助的人一起,我们试图弄清楚这一点。 我对它不知道该如何运作感到非常盲目,因此从未想过尝试并建立另一个项目并查看是否可行。 我完全专注于会员中心内的证书和个人资料以及xcode中的帐户详细信息。 当我试图建立另一个(随机)项目时,它一气呵成。 这告诉我们它必须与xcode无法编码的特定项目的构建设置有关。 最后,在xcode中,我去了我的目标的生成设置 。 在代码签名部分中,我将Any iOS SDK的值更改为指向我的钥匙串中的特定标识,而不是自动启用它们( iOS Develope ...
-
XCode 5和iOS 6和7(XCode 5 and iOS 6 and 7)[2022-02-20]
XCode 4.6无论如何都不支持iOS 7。 您将只能构建将在iOS 7上运行的iOS 6应用程序,但您将无法使用新的iOS 7 SDS功能。 如果您想支持iOS 7功能,则需要使用Xcode 5.这可能还会在您的应用中引起一些视觉问题。 我的建议是迁移到Xcode 5,然后检查你的应用程序中的所有内容是否正常,或者进行必要的更改以便在iOS 7上正常运行。 在任何情况下,如果您发现任何事情都无法按预期运行,您可以安全地从Xcode 5返回到Xcode 4。 XCode 4.6 will not supp ... -
使用Vim开发iOS或Mac可以真正强大而快速,特别是如果您使用TDD或需要快速反馈。 但是需要一点点才能使它工作。 你需要知道的几件重要的事情是: 使用xcodebuild命令行工具从一些vimscript运行你的构建和单位。 使用clang_complete插件可以在vim内给你完整的代码完成。 使用ios.vim和cocoa.vim插件进行导航。 这是我首选的工作方法。 事实上,我写了ios.vim插件,使更容易为更多的人。 Developing for iOS or Mac with Vim can ...
-
要轻松完成此操作,您可以: 1-创建一个继承自UIViewController的UIViewControllerEnhanced视图控制器 2-覆盖它的viewDidLoad方法(或任何init方法,具体取决于你想要的),如下所示: - (void) viewDidLoad { [super viewDidLoad]; NSLog(@"viewDidLoad for class %@", self.className); } 在项目中,在UIViewControllerEnhanced类中 ...
-
解决问题的办法是检查“IOS 7及更高版本”复选框,然后填写所需的图标。 这很奇怪,因为我的目标是iOS 8.0及以上版本。 不知道这是有意的还是一个错误。 干杯! The solution to the problem was to also check the "IOS 7 and later checkbox" and then fill in the required icons. This is strange, since I am targeting IOS 8.0 and above. No ...
-
不,根本不需要您只需要使用该开发者ID注册您的手机,然后使用正确的条款签署您的应用程序。 这就是你需要做的一切。 (xcode具有针对未注册和注册用户的精确构建) No, no need at all you just need to register your phone with that developer id and then sign your application with correct provision . that's all you need to do. (xcode have ...
-
Xcode 4.5 - iOS开发(Xcode 4.5 - iOS development)[2024-05-02]
它位于右下角 It's at the bottom right corner -
不,您必须更新到更新版本的iOS,或使用bootcamp使用旧版XCode启动Lion。 No, you'll have to update to a newer version of iOS, or use bootcamp to boot to Lion with an older XCode.