 
	
		
		
		
		
			
- 
		AuthorPosts
- 
		
			
				
March 20, 2015 at 12:41 am #414925Hi, I am creating a custom quick escape button based on the following code” ‘function getAway() { 
 // Get away right now
 window.open(“http://weather.com”, “_newtab”);
 // Replace current site with another benign site
 window.location.replace(‘http://google.com’);
 }$(function() { $(“#get-away”).on(“click”, function(e) { 
 getAway();
 });$(“#get-away a”).on(“click”, function(e) { 
 // allow the (?) link to work
 e.stopPropagation();
 });$(document).keyup(function(e) { 
 if (e.keyCode == 27) { // escape key
 getAway();
 }
 });});’ where should I place this code if I want it to appear on every page? thanks! March 20, 2015 at 12:58 am #414927Hi MindSpark! Please try adding following code to Functions.php file in Appearance > Editor – http://pastebin.com/kWZqmH00 Best regards, 
 YigitMarch 20, 2015 at 1:48 am #414952thanks Yigit. the code is in but nothing is visible. it should look like this: https://css-tricks.com/examples/OpenCloseWindow/ I placed the button html in a footer widget but nothing is visible March 20, 2015 at 1:50 am #414954March 20, 2015 at 1:51 am #414955thanks Yigit. http://lbdsociety.org March 20, 2015 at 1:52 am #414956the button is visible now, but : 1. nothing happens when I click on it 
 2. how can I float the button so that is always at the bottom right of the screen?March 20, 2015 at 7:08 pm #415473hello? March 22, 2015 at 10:28 pm #416089Hi! Try with this code instead: function add_custom_script(){ ?> <script> (function($){ $(window).load(function() { function getAway() { // Get away right now window.open("http://weather.com", "_newtab"); // Replace current site with another benign site window.location.replace('http://google.com'); } $("#get-away").on("click", function(e) { getAway(); }); $(document).keyup(function(e) { if (e.keyCode == 27) { // escape key getAway(); } }); }); })(jQuery); </script> <?php } add_action('wp_footer', 'add_custom_script');Please note that debugging third-party custom scripts is outside our support scope. Best regards, 
 JosueMarch 22, 2015 at 10:45 pm #416101thanks for trying to help. that didn’t work either :( March 22, 2015 at 11:12 pm #416117I’m not seeing it added on your install yet. I’ve tested that on my local install and it did work. Cheers! 
 JosueMarch 22, 2015 at 11:20 pm #416125When I load that code in the child theme functions.php file, the whole site turns white and I cant access it..? weird March 22, 2015 at 11:26 pm #416130actually, it works fine in the parent theme,,,, thanks! but not in the child theme March 22, 2015 at 11:54 pm #416144Well, must be a syntax error somewhere in your child theme functions.php. Cheers! 
 Josue
- 
		AuthorPosts
- You must be logged in to reply to this topic.
