Created
November 5, 2014 08:20
-
-
Save henrikakselsen/f662e848e77698fbf5bc to your computer and use it in GitHub Desktop.
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
<!DOCTYPE html> | |
<body id="iframebody"> | |
<button class="btn" id="hello-btn">Hello</button> | |
</body> | |
<footer> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$('.btn').each(function() { | |
var holder = $(this); | |
holder.on('click',function() { | |
var event = $.Event( 'nav_button_pressed' ); | |
event.el_id = holder.attr('id'); | |
// Trigger | |
parent.$('body').trigger(event); | |
// This also works: parent.$('#parentbody').trigger(event); | |
}); | |
}); | |
</script> | |
</footer> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment