Wo müsste ich denn Live oder Delegate angeben?
Ich habe den Code bis jetzt so (dialogbox init geändert und href geändert):
Code:
function click_event(href)
{
$.ajax({
type: "POST",
dataType: "html",
url: href,
data: "ajax_req=1",
success: function(html){
$("#mainbox").html(html);
$("#mainbox").html(html).find("a").click(function(){
click_event($(this).attr("href"));
});
}
});
$.ajax({
type: "POST",
dataType: "html",
url: href,
data: "ajax_req=2",
success: function(html){
$("#nav_left").html(html);
$("#nav_left").html(html).find("a").click(function(){
click_event($(this).attr("href"));
});
}
});
return false;
}
$(document).ready( function() {
$("a").bind("click", function() { return false; })
$("a").addClass("mainbox");
$("a.ContentFadeIn").removeClass("mainbox");
$("#loading").ajaxStart(function(){
$(this).fadeTo(100, 1);
});
$(".mainbox").click(function () {
click_event($(this).attr("href"));
});
$("#loading").ajaxStop(function(){
$(this).hide();
});
$("#dialogBox").dialog({
autoOpen: false,
modal: true,
draggable: false,
resizable: false,
maxWidth: 900,
show: "slide",
closeOnEscape: true,
width: 900,
height: 700,
position: "top"
});
$("#dialogBox").css("font-size", "10px");
$(".ContentFadeIn").click(function () {
$.ajax({
type: "POST",
dataType: "html",
url: $(this).attr("href"),
data: "ajax_req=1",
success: function(html){
$("#dialogBox").html(html);
$("#dialogBox").dialog("open");
}
});
});
});
Wie muss ich das denn jetzt genau einbauen?