【发布时间】:2015-12-07 15:39:20
【问题描述】:
我是新来的,所以如果我的问题已经得到解答,请不要跳到我的喉咙里;不过我一直在寻找答案。
好的,这就是我需要做的: 在我忙的网站上,有一个外部 css 修改的超链接标签,看起来像一个按钮。单击后,它将用户重定向到注册页面。 超链接元素的html和css:
.button_promo {
background: transparent none repeat scroll 0 0;
border: 3px solid #ef4923;
border-radius: 6px;
color: #787878;
cursor: pointer;
display: inline-block;
font-family: Vag, helvetica, arial;
font-size: 17px;
font-weight: 500;
letter-spacing: 1px;
line-height: 21px;
outline: 0 none;
padding: 7px 25px;
position: relative;
text-align: center;
text-decoration: none;
transition: background-color 0.2s ease-in-out 0s, color 0.2s ease-in-out 0s, border-color 0.2s ease-in-out 0s;
width: 200px;
}
<ul>
<li><a href="signup.html" class="button_promo">Sign up</a>
</li>
</ul>
我需要做的是改变元素的功能,这样当用户点击它时,它会弹出一个弹出窗口。但是,这是我需要使用的弹窗功能代码:
(function() {
var e = document.createElement('script');
e.type = 'text/javascript';
e.async = true;
e.src = ('https:' == document.location.protocol ? 'https' : 'http') +
'://btn.createsend1.com/js/sb.min.js?v=3';
e.className = 'createsend-script';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(e, s);
})
();
<div class="createsend-button" style="height:27px;display:inline-block;" data-listid="i/41/44A/73A/85038CAF46C6F93F">
</div>
弹出功能代码创建它自己的按钮,但我不希望这样。我需要将它链接到超链接标签,而不改变链接的样式。因此,我需要该功能不是创建它自己的按钮,而是执行单击链接后弹出所需弹出窗口的实际动作。
有什么想法吗?
【问题讨论】:
-
你可以使用模态窗口吗?
标签: javascript jquery html css hyperlink