Javascript 使用单击时的弹出信息自动设置徽标动画
我如何才能使一个标志浮动到右侧时,自动点击,并使弹出显示一些信息。 现在我使用了一个按钮,但我想使用一个徽标。那么,我如何才能输入图像,而不是按钮,以及单击该徽标图像时出现的弹出窗口。要使用图像作为弹出窗口的触发器,看起来您使用的是id打开弹出窗口。你可以删除按钮并添加一个图像,或者在按钮中添加一个图像。我喜欢按钮,但是你必须采取措施取消它的样式-这样一个标签-或者你喜欢的任何东西+添加打开弹出窗口的id ..按钮id=打开弹出窗口> …$“打开-弹出”。放大弹出{ 至于在单击时移动徽标……您可以使用jQuery/JavaScript添加一个类,该类可以执行动画 jQuery 风格Javascript 使用单击时的弹出信息自动设置徽标动画,javascript,html,css,Javascript,Html,Css,我如何才能使一个标志浮动到右侧时,自动点击,并使弹出显示一些信息。 现在我使用了一个按钮,但我想使用一个徽标。那么,我如何才能输入图像,而不是按钮,以及单击该徽标图像时出现的弹出窗口。要使用图像作为弹出窗口的触发器,看起来您使用的是id打开弹出窗口。你可以删除按钮并添加一个图像,或者在按钮中添加一个图像。我喜欢按钮,但是你必须采取措施取消它的样式-这样一个标签-或者你喜欢的任何东西+添加打开弹出窗口的id ..按钮id=打开弹出窗口> …$“打开-弹出”。放大弹出{ 至于在单击时移动徽标……您可
有许多不同的弹出窗口/灯箱。如果放大弹出窗口不令人愉快,请尝试另一个。有很多方法可以做到这一点。您可以使用css动画或Jquery或velocityjs之类的动画库。您尝试过使用其中任何一个吗?欢迎使用Ankit。您需要提供一些代码并解释您迄今为止尝试过的内容-并询问v关于代码的非常具体的问题。请尝试在此处进行测试:@sheriffderek我需要帮助
> <!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
<body>
<button id="open-popup">Open popup</button>
<div id="my-popup" class="mfp-hide white-popup">
Inline popup
</div>
<style>
#open-popup {padding:20px}
.white-popup {
position: relative;
background: #FFF;
padding: 40px;
width: auto;
max-width: 200px;
margin: 20px auto;
text-align: center;
}
</style>
<script type="text/javascript">
$('#open-popup').magnificPopup({
items: [
{
src: 'http://upload.wikimedia.org/wikipedia/commons/thumb/6/64/Peter_%26_Paul_fortress_in_SPB_03.jpg/800px-Peter_%26_Paul_fortress_in_SPB_03.jpg',
title: 'Peter & Paul fortress in SPB'
},
{
src: 'http://vimeo.com/123123',
type: 'iframe'
},
{
src: $('<div class="white-popup">Dynamically created element</div>'), // Dynamically created element
type: 'inline'
},
{
src: '<div class="white-popup">Popup from HTML string</div>',
type: 'inline'
},
{
src: '#my-popup',
type: 'inline'
}
],
gallery: {
enabled: true
},
type: 'image'
});
<script>
</body>
</html>
$('.element').on('click', function() {
$(this).addClass('active'); // $(this) refers to the element clicked in this case
});
.element {
transition: .5s; // set speed (look up other options)
}
.element.active {
transform: translate(50%, 0); // random movement example
}