jqueryuiswitchClassメソッドを使用しようとしています。現在、それはそのように機能します:
$("#top_section").switchClass( "top_section", "pt_figures", 300);
変更したいのは、だけを削除するのではなく、top_section
すべてのクラスを削除してから追加したいpt_figures
です。
ここで動作します:
$("#close_icon").click(function() {
$("#top_section").removeClass();
$("#top_section").addClass( "top_section", 300);
setTimeout(function() {
$('#images').empty();
}, 350);
});
しかし、ここではありません:
$("#pt_figures").click(function() {
$('#images').empty();
$('#images').css({
paddingLeft: 150,
paddingRight: 0
});
$('#controls').css({
width:700,
marginLeft:150
});
$('#info').css({
width:660,
marginLeft:150
});
var id = $(this).attr('id');
$("#info_header").load(id +"_header.txt");
$("#content_1").load(id +"_1.txt");
$("#content_2").load(id +"_2.txt");
$("#content_3").load(id +"_3.txt");
$("<img>", { src: "http://www.klossal.com/figures_doc.jpg" }).appendTo("#images");
$("<img>", { src: "http://www.klossal.com/figure_front.png" }).appendTo("#images");
$("<img>", { src: "http://www.klossal.com/figure_back.jpg" }).appendTo("#images");
$('html, body').animate({
scrollTop: 0
}, 300);
$("#top_section").removeClass();
$("#top_section").addClass( "pt_figures", 300);
});