[jQuery] jquery/livequery assign behaviour to element by class
Currently I am using $(document).ready to bind some behaviours to elements
in the DOM based on a class name (using jquery's .filter) - This works great
on the initial load of the page however these bindings get all screwy when I
try injecting or editing new elements to the DOM dynamically via AJAX.
After researching the issue I have been trying to use the livequery plug-in
but have been unsuccessful so far.
In $(document).ready I am assigning behaviour to td elements of the class
"hasContent". I am looking to hook them up to livequery listeners so that
the correct behaviours are assigned when the DOM is updated.
$(document).ready(function(event) {
var position = function() {
}
var showBox = function() {
}
var hideBox = function() {
}
var showDetail = function() {
}
//Syntax help below
$("table tbody td").filter(".hasContent").hover(showBox,
hideBox).mousemove(position);
$("table tbody td").filter(".hasContent").click(showDetail);
});//EOF
Can anybody help me with the syntax necessary to get livequery to
bind/unbind the necessary behaviours to the table tds?
Thanks for the help.
--
View this message in context: http://www.nabble.com/jquery-livequery-assign-behaviour-to-element-by-class-tp19496825s27240p19496825.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.