/* 2013-07-23 Dropbox °ü·Ã js */ function showSelect(iList) { $("ul.iList").each(function() { $(this).css("z-index", "0"); $(this).parent("div.select").removeClass("open"); $(this).parent("div.select").css("z-index", "0"); }); iList.parent("div.select").addClass("open"); iList.parent("div.select").css("z-index", "1000"); iList.css("z-index", "1000"); iList.show(); } function hideSelect(iList) { iList.parent("div.select").removeClass("open"); iList.css("z-index", "0"); iList.hide(); } function showSelectOption(obj) { var iList = obj.parent().children("ul.iList:first"); if (iList.css("display") == "none") { showSelect(iList); } else { hideSelect(iList); } } function setSelectObject() { $(".select_radios, .select_beply").each(function() { $(this).attr("hasEvent", "Y"); var select = $(this).children("div.select:first"); var selectCtrl = select.children('.ctrl'); var selectiList = select.children("ul.iList"); select.css("z-index", "0"); selectiList.css('position', 'absolute'); selectiList.hide(); select.children("span.ctrl, div.myValue").click(function() { var iList = $(this).parent().children("ul.iList:first"); if (iList.css("display") == "none") { showSelect(iList); } else { hideSelect(iList); } }); selectiList.children('li').click(function() { var parent_select = $(this).parent('ul.iList').parent('div.select'); hideSelect($(this).parent('ul.iList')); var txt = $(this).children('label').text(); $(this).children('input').attr('checked', true); $(this).parent('ul.iList').prev('.myValue').text(txt); $(this).parent('ul.iList').prev('.myValue').addClass('selected'); }); select.hover(function() { }, function() { var iList = $(this).children("ul.iList:first"); hideSelect(iList); }); selectiListMouseOver(selectiList); }); // Radio Default Value $('div.myValue').each(function(){ var hasFirst = $(this).attr("hasFirst"); if (hasFirst != undefined && hasFirst == 'Y') return; $(this).attr("hasFirst", "Y"); var default_value = $(this).next('.iList').find('input[checked]').next('label').text(); $(this).text(default_value); // ÆøÁ¶Àý var w = $(this).parent().css("width").replace("px", ""); if (w != "") { w = parseInt(w) - 25; $(this).css("width", String(w) + "px"); } // °ªÀÌ 9°³ ÀÌ»óÀÎ °æ¿ì ³ôÀÌ °ª ÁöÁ¤ $(this).next('.iList').each(function() { if ($(this).children('li').length > 8) { $(this).css("height", "189px"); } }); }); } $(function() { //setSelectObject(); setTimeout(setSelectObject, 300); }); function selectiListMouseOver(obj) { obj.children("li").mouseover(function() { $(this).parent("ul:first").children('li').removeClass('hover'); $(this).toggleClass('hover'); }); } function setCheckedInput(name, val) { $("input:radio[name=" + name + "][value=" + val + "]").attr("checked", true); var text = $("input:radio[name=" + name + "]:checked").parent().children("label").html(); $("input:radio[name=" + name + "]").parent().parent().parent().children(".myValue").html(text); } function setSelectDataAndFunction(iList, data, func) { iList.html(data); var className = iList.children("li").children("input:first").attr("name"); setCheckedInput(className, ""); selectiListMouseOver(iList); iList.children("li").each(function() { $(this).click(function() { setCheckedInput(className, $(this).children("input").val()); hideSelect(iList); if (func != null && func != undefined) { func.call(); } }); }); } function loadSelectInSpan(id, exec_func) { var first_id = ""; var noCheck = true; $("#" + id).children("li").children("input").each(function() { $(this).click(function() { $(this).attr("checked", true); $(this).parent().parent().parent().children(".myValue").text($(this).parent().children("label").text()); var t = $(this); setTimeout(function(){ t.parents('div.select:first').removeClass('open'); t.parents('div.select:first').children('.iList').css('z-index', '0'); }, 1); }); if (exec_func != null && exec_func != undefined) { $(this).change(exec_func); } var this_id = $(this).attr("id"); if (this_id != undefined && this_id != "" && first_id == "") { var temp = this_id.split('_'); if (temp[1] == '0') first_id = this_id; } if ($(this).attr("checked")) { noCheck = false; $(this).parent().parent().parent().children(".myValue").text($(this).val()); } }); if (noCheck && first_id != "") { $("#" + first_id).attr("checked", true); $("#" + id).parent().children(".myValue").text($("#" + first_id).parent().children("label").text()); } $("#" + id).children("li").each(function() { $(this).hover(function() { $(this).addClass("hover"); }, function() { $(this).removeClass("hover"); }); }); }