Forum Moderators: open
// the JavaScript
document.onclick = function() {
if (toggle.el) $('#' + toggle.el).hide();
}
$.fn.toggleClick = function(e) {
toggle.el = this.attr('id');
this.toggle();
}
// the HTML to open the Ajax script
<div onClick="$('#bar').toggleClick(event);
$('#bar').ajax('foo.php');">
Blah
</div>
<div id="bar" style="display: none"></div>
// and inside of foo.php
<div id="someMenu"
onMouseOver="toggle.el= false;"
onMouseOut ="toggle.el= 'bar';">
Blah
</div> // the JavaScript
document.onclick = function() {
if (toggle.el) $('#' + toggle.el).hide();
if (otherVariables)
// do stuff
}
$.fn.toggleClick = function(e) {
toggle.el = this.attr('id');
this.toggle();
}
// the HTML to open the Ajax script
<script>
var otherVariables = 'stuff';
</script>
<div onClick="$('#bar').toggleClick(event);
$('#bar').ajax('foo.php');">
Blah
</div>
<div id="bar" style="display: none"></div> // I tried 'hide' and 'blur' with no luck
$('#bar').on('hide', function () {
// do stuff
});
// the main JavaScript
document.onclick = function() {
if (toggle.el) $('#' + toggle.el).hide();
if (typeof closeAjaxCallback == 'function')
closeAjaxCallback();
}
$.fn.toggleClick = function(e) {
toggle.el = this.attr('id');
this.toggle();
}
// the HTML page that opens the Ajax script
<script>
function closeAjaxCallback() {
alert(otherVariables);
}
</script>
<div onClick="$('#bar').toggleClick(event);
$('#bar').ajax('foo.php');">
Blah
</div>
<div id="bar" style="display: none"></div>
// and inside of foo.php
<script>
var otherVariables = 'stuff';
</script> <input name="blog_post_thread_comment" type="submit" />