I've been experimenting with a jQuery script to grey out the screen. While it works perfectly on my jsFiddle link provided below, I'm having trouble getting it to work from within my WordPress plugin.
Check out the working script on my jsFiddle here
This is the PHP code I'm using to include the JavaScript:
function myScripts() {
wp_enqueue_script('myScript', plugins_url('myPlugin/JS/myScript.js'), array('jquery'), true);
}
add_action('wp_enqueue_scripts', 'myScripts');
Here's the HTML code snippet:
<div id="box"></div>
<img id="something" src="http://www.w3schools.com/images/w3schools.png" />
And this is the content of myScript.js file, which contains the jQuery code:
$(document).ready(function() {
$('#something').click(function() {
$('#box').show();
$('#box').fadeTo(500, 0.5);
});
});