takeitover.js - Download here
This a plugin for content to show as a takeover, or popup if you will. You simply just add a single file for your project and follow the guide, and you will be able to show content in a popup. It simply and works very well.
Add this just before the body end tag.
<!-- JQUERY LIBARY -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- TAKEITOVER -->
<script src="YOURLOCATION/takeitover.min.js"></script>
<script>
$(document).ready(function(){
// select the element you want to have as trigger for the takeitover content
$(".takeitover-trigger").takeitover();
});
</script>
Inlcude the takeitover.min.js in your project.
<div class="takeitover-trigger">
<!-- this the element you click to open your takeover -->
</div>
<div class="takeitover-content">
<!-- This is the content that will be shown in a takeover -->
<!-- Inside here you can put your own markup and all of it will be shown in a takeover -->
</div>
<div class="takeitover-trigger" data-target="#target">
<!-- add 'data-target' attribute to target a element -->
</div>
<div class="takeitover-content" id="target">
<!-- By doing this you can place this element anyplace you want in the document -->
</div>
Adjust the speed of the animation
Jquery UI easings. Needs to have jquery UI installed for this to work.
This is the content selector that displays in the takeover
The background color of the overlay
Detects weather the takeover should close when the user clicks the overlay
Set to false if you dont want to show any closeButton
Control the color of the close button
The before function for when animation has started
The callback function for when animation has
<script>
$(document).ready(function(){
$(".takeitover-trigger").takeitover({
callback: function(){
// do something
},
});
});
</script>
Call a function when takeitover closes
<script>
$(document).ready(function(){
$(".takeitover-trigger").takeitover({
speed: 500,
easing: false,
contentSelector: '.takeitover-content',
background: 'rgba(255,255,255,0.95)',
clickOnOverlay: true,
closeButton: true, // false if you dont want to display the close button
buttonColor: "black", // write any color you want
before: function(trigger, target){ // you can now do something with the triggerselector ('trigger') or the target selector ('target')
// do something
},
callback: function(trigger, target){ // you can now do something with the triggerselector ('trigger') or the target selector ('target')
// do something
},
closeFunction: function(){
// do something
}
});
});
</script>