This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//bind a click on #demo link and append the iframe in a div to the body, style the overlay | |
$(document).ready(function() { | |
var winWidth = $(window).width(); //get the current window width | |
var winHeight = $(window).height(); //get the current window height | |
var edgeSpace = 40; //we want the overlay to be 40px away from the edge | |
var iframeWidth = winWidth - edgeSpace * 2; //calculate the actual width of the iframe | |
var iframeHeight = winHeight - edgeSpace * 2; //calculate the actual height of the iframe | |
$('#demo').click(function() { //bind a click event to the #demo link | |
//append the overlay div with the iframe in it to the body |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//adding a close button to the overlay and bind a click on it to close the overlay | |
$(document).ready(function() { | |
var winWidth = $(window).width(); | |
var winHeight = $(window).height(); | |
var edgeSpace = 40; | |
var iframeWidth = winWidth - edgeSpace * 2; | |
var iframeHeight = winHeight - edgeSpace * 2; | |
$('#demo').click(function() { | |
//add a close anchor inside the overlay div |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//resize the iframe when the window is resized | |
$(document).ready(function() { | |
function refreshSettings() { //update the settings when calling this function | |
winWidth = $(window).width(); | |
winHeight = $(window).height(); | |
edgeSpace = 40; | |
iframeWidth = winWidth - edgeSpace * 2; | |
iframeHeight = winHeight - edgeSpace * 2; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//check for the OS, if we are on a mac align the close button to the left, otherwise to the right | |
$(document).ready(function() { | |
function refreshSettings() { | |
winWidth = $(window).width(); | |
winHeight = $(window).height(); | |
edgeSpace = 40; | |
iframeWidth = winWidth - edgeSpace * 2; | |
iframeHeight = winHeight - edgeSpace * 2; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="navigation"> | |
<?php if(function_exists("wp_pagenavi")) : ?> | |
<?php wp_pagenavi(); ?> | |
<?php else : ?> | |
<div class="alignleft"><?php next_posts_link('« Older Entries') ?></div> | |
<div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div> | |
<?php endif; ?> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$plugins = array( | |
array( | |
"name" => "Plugin-1", | |
"function" => "plugin_1", | |
"plugin" => "plugin-1" | |
), | |
array( | |
"name" => "Plugin-2", | |
"function" => "plugin_2", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$plugins = array( | |
array( | |
"name" => "WP-PageNavi", | |
"function" => "wp_pagenavi", | |
"plugin" => "wp-pagenavi" | |
) | |
); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include "requiredplugins.php"; | |
add_action("wp_head", "includePluginCss"); | |
add_action("wp_footer", "outputPluginOverlay"); | |
function includePluginCss() { | |
global $plugins; | |
foreach($plugins as $plugin) { | |
if(!function_exists($plugin["function"])) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include "requiredplugins.php"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action("wp_head", "includePluginCss"); | |
add_action("wp_footer", "outputPluginOverlay"); |
OlderNewer