我也想爲每個州和每個城市設置一個鏈接。 當國家李是徘徊我只希望這個州的城市顯示.... 但我知道只有一個小jQuery代碼和IM不理想的選擇器, 即時通訊不知道如何使用。每個jquery函數....請幫助!!!! PHP代碼:鼠標進入鼠標離開幫助一個大的信息
<?
$everything = array(
'states'=>array(
'Alabama'=>array('Birmingham,Montgomery,Mobile,Huntsville,Tuscaloosa'),
'Alaska'=>array('Anchorage,Juneau,Fairbanks,Sitka,Ketchikan'),
'Arizona'=>array('Phoenix,Tuscon,Mesa,Glendale,Scottsdale'),
'Arkansas'=>array('Little Rock,Fort Smith,North Little Rock,Fayetteville,Jonesboro'),
)
);
$id = md5(0);
$controll = 0;
$here = md5('states');
echo "<div id=\"9090\"><ol id=\"selectable\">";
foreach($everything['states'] as $state=>$city){
$citys = explode(',',$city[0]);
echo "<li class=\"ui-state-default\"><a class=\"contr\" href=\"#\">$state</a> <div class=\"citys\">";
foreach($citys as $key=>$x){
echo "<a href=\"#\">$x</a><br>";
}
"</div></li>";
}
echo "</ol></div>";
?>
的jQuery:
<script>
$(function() {
$("#selectable").selectable();
});
$('.ui-state-default').mouseenter(function(e) {
// here when i hover over this state all citys show i just want the cities for this sate
$('.citys').toggle();
}).mouseleave(function(e) {
// here when i leave this state li all theese citites should leave
$('.citys').toggle();
});;
</script>