选中Fragment2 fragment = new Fragment2();
setSharedElementReturnTransition(TransitionInflater.from(getActivity()).inflateTransition(R.transition.change_image_trans));
setExitTransition(TransitionInflater.from(getActivity()).inflateTransition(android.R.transition.fade));
fragment.setSharedElementEnterTransition(TransitionInflater.from(getActivity()).inflateTransition(R.transition.change_image_trans));
fragment.setEnterTransition(TransitionInflater.from(getActivity()).inflateTransition(android.R.transition.fade));
FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction()
.replace(R.id.button_container, fragment)
.addToBackStack("transaction")
.addSharedElement(view, "button_transition")
.commit();
复选框后,如何禁用name="check_no[]"
复选框?
name="check_yes[]"
答案 0 :(得分:0)
您可以使用lesser.txt
和closest()
的组合来获取相邻子项复选框,然后使用find()
禁用它,如下所示:
prop()
$('table :checkbox').change(function() {
$(this).closest('tr').find(':checkbox').not(this).prop('disabled', true);
});
答案 1 :(得分:0)
$("table [name='check_yes[]']").change(function() {
if($(this).is(":checked")) {
$("[name='check_no[]']").prop('disabled', true);
}
});
如果已检查,则会侦听任何check_yes []检查并禁用页面上的所有其他check_no []
答案 2 :(得分:0)
function enab1() {
document.getElementById("check_no").disabled = true;
}
function enab2() {
document.getElementById("check_yes").disabled = true;
}
你的HTML代码中的
<input type="checkbox" name="check_yes[]" value="yes" onclick="enab1()">
<input type="checkbox" name="check_no[]" value="yes" onclick="enab2()">
希望这会有效