我想要顯示的第二個下拉在同一個彈出窗口 。之後我選擇語言(Language下拉列表)名單(國家列表),我要顯示第二次下降downlist在同一個彈出窗口
的國家下拉列表顯示國家細節,這些細節與我在第一個下拉列表中選擇的語言(語言下拉列表)相關,但它在後臺顯示,我想在相同的彈出窗口中顯示國家(Dorp下拉列表)用於選擇語言。
注:選擇 值後語言下拉應該消失,鄉村下拉需要在同一個彈出顯示
jQuery的
$(document).ready(function() {
var id = '#dialog';
//Get the screen height and width
var maskHeight = $(document).height();
var maskWidth = $(window).width();
//Set heigth and width to mask to fill up the whole screen
$('#mask').css({'width':maskWidth,'height':maskHeight});
//transition effect
$('#mask').fadeIn(500);
$('#mask').fadeTo("slow",0.9);
//Get the window height and width
var winH = $(window).height();
var winW = $(window).width();
//Set the popup window to center
$(id).css('top', winH/2-$(id).height()/2);
$(id).css('left', winW/2-$(id).width()/2);
//transition effect
$(id).fadeIn(2000);
//if close button is clicked
$('.window .close').click(function (e) {
//Cancel the link behavior
e.preventDefault();
$('#mask').hide();
$('.window').hide();
});
//if mask is clicked
$('#mask').click(function() {
var val = $(".cs-select option:selected").text();
if(val == 'Choose Language'){
return;
}
$(this).hide();
$('.window').hide();
});
$(document).click(function() {
if (!$(".cs-select ").is(":focus")) {
$('#dialog').css({'height':23});
}else{
var height = 17;
$('.cs-select option').each(function (item) {
height = height +17;
})
if($('#dialog').height() < 25){
$('#dialog').css({'height':height});
}else{
$('#dialog').css({'height':23});
}
}
});
});
/*select your country*/
$(document).ready(function() {
$('#Rank').bind('change', function() {
var elements = $('div.container').children().hide(); // hide all the elements
var value = $(this).val();
if (value.length) { // if somethings' selected
elements.filter('.' + value).show(); // show the ones we want
}
}).trigger('change');
});
感謝它的工作正常@nashcheez –
不客氣。 – nashcheez