I need to make a button which, when pressed, will trigger a jQuery.post() event repetitively. The second event should be triggered 500ms after the first, and a volley of rapid-fire events should be subsequently triggered thereafter.
In other words, the button should simulate what happens when you press the Volume up/down buttons of a remote control. I suspect that there may be a jQuery method that does just that - but I wouldn't know how. Do you?
here is the code:
jQuery("projTable").click(function(event) {
var contentPanelId = jQuery(this).attr("id");
});
$("[class*=triggerZone]").children().click(function(event)
{var buttonArray = [event.target.id, event.target.className, event.target.parentNode.parentNode.parentNode.id];
var triggerObject =
{eventTargetId: event.target.id,
eventTargetClassName: event.target.className.split(" "),
eventTargetParentNodeParentNodeId: event.target.parentNode.parentNode.id,
eventTargetParentNodeParentNodeParentNodeId: event.target.parentNode.parentNode.parentNode.id};
processAction(triggerObject);});
});
function processAction(triggerObject)
{ $.ajax({
type: "POST",
url: '../json_api/WohnZimmerControl.php',
data: triggerObject,
}
});