【www.bbyears.com--jquery】
<script src="jquery-1.3.2.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
$(".CRselectBox").hover(function(){
$(this).addClass("CRselectBoxHover");
},function(){
$(this).removeClass("CRselectBoxHover");
});
$(".CRselectValue").click(function(){
$(this).blur();
$(".CRselectBoxOptions").show();
return false;
});
$(".CRselectBoxItem a").click(function(){
$(this).blur();
var value = $(this).attr("rel");
var txt = $(this).html();
$("#abc").val(value);
$("#abc_CRtext").val(txt);
$(".CRselectValue").html(txt);
$(".CRselectBoxItem a").removeClass("selected");
$(this).addClass("selected");
$(".CRselectBoxOptions").hide();
return false;
});
/*点击任何地方关闭层*/
$(document).click(function(event){
if( $(event.target).attr("class") != "CRselectBox" ){
$(".CRselectBoxOptions").hide();
}
});
})
</script>
jquery实现下拉框选择图片效果
" name="abc_CRtext" id="abc_CRtext"/>