controlling div with radio box cross frame
edit:it worked problem was with name i passed wrong name(a space >_<)
i have 4 div that have same id as my radio box both in diferent frame, when clicking on a radio box i want all div disapear (fadeOut) and the div with sam开发者_开发百科e id of my current radio box appear(fadeIn) its working with $("input[type=radio]") but when using $("input[type=radio][name=zone1_1]") it dont work
verif_check(id_check)//id_check is id of my the radiobox i clicked in
{
$(document).ready(function(){
$("input[type=radio][name=zone1_1]").each(function(){
var id=$(this).attr("id");
$(parent.droite.document).contents().find(id).fadeOut();
});
$(parent.droite.document).contents().find("#"+id_check).fadeIn();
});
}
IDs shoud be unique. I.e. no two elements should have the same ID. If you want to select multiple elements use the classname instead.
You code may not be foring because you are calling find()
with the ID, not #id
. The following will go some way to rectifying your problem:
$(parent.droite.document).contents().find('#'+id).fadeOut();
I'm also puzzled by the verif_check(id_check)
wrapper. I would remove this.
精彩评论