有没有一种方法可以创建在点击或单击时翻转到另一侧(另一页)的图像?

Is there a way to create an image that flips to another side (another page) when tapped or clicked?

一位用户有一张双面名片。它的正面是主要信息,背面是次要信息。她希望在将名片发送给她的联系人时,他们只能看到名片的正面。单击它后,它应该翻转到另一侧。图像应该只是 gif 或独立于任何程序的任何其他图像格式。

我能想到的就是创建一个 gif,它在一段时间后改变到另一边,这不满足她只在点击时改变的要求。

我想到了带有热点的 ImageMap,但这也需要链接网络上的另一端(页面),这违背了图像的独立性。

非常感谢这方面的任何帮助。

GIF89a standard(我们今天使用的那个)包括所谓的 User Input 标志,它正是为此而设计的。
该标志在特定帧上设置,应该告诉 GIF 解码器在超时到期 用户与当前帧交互之前不要显示下一帧。
零超时加上非零 User Input 意味着解码器应该无限期地等待交互。

引自标准:

        v) User Input Flag - Indicates whether or not user input is
        expected before continuing. If the flag is set, processing will
        continue when user input is entered. The nature of the User input
        is determined by the application (Carriage Return, Mouse Button
        Click, etc.).

        Values :    0 -   User input is not expected.
                    1 -   User input is expected.

        When a Delay Time is used and the User Input Flag is set,
        processing will continue when user input is received or when the
        delay time expires, whichever occurs first.

不幸的是,据我所知,没有 GIF 解码器会费心去正确处理这个标志——所以我想你最好的选择是给两个帧合理的超时,10±5 秒左右。