次のページには2つのドロップダウンフィルターがあります。ユーザがドロップダウン1で選択してオプションを選択すると、ドロップダウン2の下の何百ものオプションのリストが、ユーザが選択するために表示される。このソリューションは機能しますが、最初の訪問時にページの読み込みに非常に負荷がかかります。ドロップダウンメニューロード時の選択、ページロードでない
ページが読み込まれたときにすべてのiframeが一度に読み込まれるのではなく、ユーザーがドロップダウンでオプションを選択したときにiframeを読み込む方法はありますか?
ここにJSFiddleがあります。どんな助けでも本当に感謝しています。
おかげで、
$(document).ready(function() {
$("select").change(function() {
$(this).children("option:selected").each(function() {
if ($(this).attr("value") == "catlist") {
$(".queuelist").hide();
$(".agentlist").hide();
$(".queuecard").hide();
$(".agentcard").hide();
$(".catlist").show();
}
if ($(this).attr("value") == "queuelist") {
$(".agentlist").hide();
$(".agentcard").hide();
$(".queuecard").hide();
$(".queuelist").show();
$(".queuelist select").change();
}
if ($(this).attr("value") == "agentlist") {
$(".queuelist").hide();
$(".agentcard").hide();
$(".queuecard").hide();
$(".agentlist").show();
$(".agentlist select").change();
}
if ($(this).attr("value") == "MPFUC") {
console.log("FUC");
$(".agentcard").hide();
$(".queuecard").hide();
$(".MPFUC").show();
}
if ($(this).attr("value") == "MPFLC") {
console.log("FlC");
$(".agentcard").hide();
$(".queuecard").hide();
$(".MPFLC").show();
}
if ($(this).attr("value") == "claire") {
$(".agentcard").hide();
$(".queuecard").hide();
$(".claire").show();
}
if ($(this).attr("value") == "darren") {
$(".agentcard").hide();
$(".queuecard").hide();
$(".darren").show();
}
});
}).change();
});
ajaxコールのロードコンテンツはどうなりますか? –
私はこれで比較的新しいです。万が一コードを手助けすることができますか? –
あなた自身で試してみることをお勧めします。それはとても簡単です。 –