使用 jQuery(或 CSS3)翻转 Div
我有一个 div,其中包含一个图像,该图像是指向网站上另一个页面的链接。我想翻转这个。图像“反面”上的内容将是文本,其中还可能包含进一步的链接。
我见过 Flip、QuickFlip 1&2 以及各种其他 CSS3 转换插件和工具,但问题是它们(据我发现)都涉及单击 div 本身来执行翻转。
因为 div 包含前后链接,这显然不适用于我的目的,我需要的是 div/翻转区域之外的按钮/点击器。出于某种原因,我没有看到任何这样的事情。
有人知道或有任何想法吗?
I have a div that contains an image which is a link to another page on the site. I want to flip this. The content on the 'reverse' of the image will be text which may also contain further links.
I have seen Flip, QuickFlip 1&2 and various other plug-ins and tuts for CSS3 Transitions BUT the issue is they all (as far as I have found) involve clicking the div itself to execute the flip.
Because the div contains links front and back this obviously won't work for my purposes and what I need is a button/clicker outside the div/flip-area. For some reason I haven't seen any such thing.
Anyone know of any or have any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这样的事情就足够了吗? (使用上述插件之一。)
然后您可以将 100% 宽度、高度的不可见 DIV 放入“应该被单击”的 DIV 内,并执行此操作以防止 DIV 内的单击执行翻转:
只需确保将 z 索引调整为您的链接等,使其位于屏蔽 DIV 的“上方”。
Would something like this be sufficient? (With the use of one of the aforementioned plugins.)
and then you can put a 100% width, height invisible DIV inside the 'supposed to be clicked' DIV and do this to prevent clicks within the DIV from executing the flip:
Just make sure to adjust the z-indexes to your links, etc are 'above' the masking DIV.
您可以使用这些插件并触发点击事件
希望这有帮助。干杯
You could use those plugins and trigger a click event
Hope this helps. Cheers
Wanovak 走在正确的轨道上,但您需要一种更跨浏览器友好的方法来阻止事件传播。试试这个:
Wanovak is on the right track, but you'll need a more cross-browser friendly approach to stopping event propagation. Try this: