I am very noob to jquery and all about it. I am doing just one page ad hoc, so I got lost. I need to display iframe as and popup. How to do it?
I tried bpopup:
index.html is like:
<button id="my-button">POP IT UP</button>
<!-- Element to pop up -->
<div id="element_to_pop_up">
<a class="b-close">x<a/>
Content of popup
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="js/jquery.bpopup.min.js"></script>
<script src="js/jquery.easing.1.3.js"></script>
<script src="js/scripting.min.js"></script>
And according to homepage of bpopup i modified jquery.bpopup.min.js
// Semicolon (;) to ensure closing of earlier scripting
// Encapsulation
// $ is assigned to jQuery
;(function($) {
// DOM Ready
$(function() {
// Binding a click event
// From jQuery v.1.7.0 use .on() instead of .bind()
$('#my-button').bind('click', function(e) {
// Prevents the default action to be triggered.
e.preventDefault();
// Triggering bPopup when click event is fired
$('element_to_pop_up').bPopup({
content:'iframe', //'ajax', 'iframe' or 'image'
contentContainer:'.content',
loadUrl:'http://dinbror.dk/search' //Uses jQuery.load()
});
});
});
})(jQuery);
and I used default CSS setting like:
#element_to_pop_up {
background-color:#fff;
border-radius:15px;
color:#000;
display:none;
padding:20px;
min-width:400px;
min-height: 180px;
}
.b-close{
cursor:pointer;
position:absolute;
right:10px;
top:5px;
}
Now the strange thing. There is an default js setting like $('#element_to_pop_up').bPopup();
that actually works, simple popup displays after clicking the button. But when I use Iframe setting (as above), nothing is happening. Nothing.
Whyyyy? I am so confused with it.
Target is to display the popup when page loads. I have seen several hints, but none of them works. Which file to modify and how????
If you know how to help, please tell me. Just don't forget I am like a little child learning to walk. So don't skip any detail like "tie shoelaces". Thanks more than a lot.