http://codepen.io/anon/pen/dXkoYp
Hello I am trying to trigger this popup after the line, I need this line to stop the page from anchoring
e.preventDefault();
I have tried to trigger it using this below but nothing shows up
$('div#popup1').trigger('click');
The expected result is this http://codepen.io/anon/pen/AXbvXZ
答案 0 :(得分:0)
it helps maybe: Stackoverflow question from '11
答案 1 :(得分:0)
Remove onclick
event attribute at div#popup1
element, e.preventDefault()
, add click
event at div#popup
, set .overlay
.css()
opacity
to 1
at div#popup1
click event handler. Not certain how to update codepen
$("#stopRed").on("click",function(e){
$("div#popup1").trigger('click');
});
$("div#popup1").click(function() {
$(".overlay").css("opacity", 1)
});