Hello,
I am trying to add a div to my container on click and inside the div - I have tabs and other events. When the page loads, the tabs and other events works but when I navigate to other div that is inside my container ... then the tabs, events inside the div stops working.
I am new to using jQuery, I tried other method from Stack-Overflow but no result.
$(document).ready(function(){
$(function() {
$('#dockmenu').delegate('.ajaxload', 'click', function(e) {
//$.ajaxSetup({ cache: false });
//alert("Hello");
e.preventDefault();
var url = $(this).attr('href');
$('#desktopcontainer').html('<span id="loader"><img src="images/preloader.gif" style="padding-bottom:5px;" /><br/>LOADING...</span>').load(url, '', function(response, status, xhr) {
if(status=='success') {
$('#content').html(response);
}
else {
var loaderror = "";
$.msgbox("<h6 class='error'>" + xhr.status + " " + xhr.statusText + "</h6>Sorry but there was an error loading the content.", {type: "error"});
}
});
return false;
e.stopPropagation();
});
});
$(function() {
//alert("Hello");
$("#innerDashboard").delegate('#testing', 'click', function() { alert("Hello"); });
$(".accordion .accordion-tabs .tab").each(function(){
$(this).click(function(){
if ($(this).hasClass('tab')){
$(this).removeClass('tab');
$(this).addClass('active');
}else{
$(this).removeClass('active');
$(this).addClass('tab');
}
$(this).next().slideToggle('slow');
return false;
});
});
});
});
Please advise me on how to go about it.
Thank you in advance.
Charles