From: Onur Yerlikaya (wxcode@gmail.com)
Date: Sat 08 Sep 2007 - 16:58:33 EEST
Anýl KARADAÐ yazmýþ:
> Merhabalar, hayýrlý ramazanlar
>
> php sayfamda yer alan a tagýnýn classýný js ile deðiþtirmek istiyorum.
> Sayfa açýldýgýnda x linkinin classý "current" dýr. ben y linkine
> týkladýðýmda x linkinin classý "out" y linkinin "current" olmalýdýr
>
> X
>
> ve js kodum
>
> var selected_id = null;
> function changebackground(menuID)
> {
>
> if(selected_id != null) {
> document.getElementById(''+selected_id+'').className = "out";
> }
> document.getElementById(''+menuID+'').className="current";
> selected_id=menuID;
>
> }
>
> Sizce sorun nerede??
>
> _______________________________________________
> Linux-programlama mailing list
> Linux-programlama@liste.linux.org.tr
> http://liste.linux.org.tr/mailman/listinfo/linux-programlama
>
>
Selamlar,
Ýstediðin sanýrým böyle birþey
<html>
<head>
<title># My Page #</title>
<script type="text/javascript">
function changeBackground(setOutId,currentId)
{
document.getElementById(setOutId).className = "out";
document.getElementById(currentId.id).className =
"current";
}
</script>
<style type="text/css">
.current {
padding : 2px;
color : navy;
background : #e7e7e7;
}
.out {
padding : 2px;
color : red;
background : #e7e7e7;
}
</style>
</head>
<body>
<a href="#" onClick="changeBackground('b',this)" id="a">Link
A</a>
<br/>
<a href="#" onClick="changeBackground('a',this)" id="b">Link
B</a>
</body>
</html>
-- Onur _______________________________________________ Linux-programlama mailing list Linux-programlama@liste.linux.org.tr http://liste.linux.org.tr/mailman/listinfo/linux-programlama