Monday, June 30, 2008

checkbox kullanmak istemediğimde

checkbox kullanmak istemediğim bi zaman yazmıştım. çok pratik geldi gözüme.
aşağıda yapmak isteiğim anlaşılıyo aslında. fakat biraz eksik yazdım.
önemli bir nokta : burdaki li ögelerini block görünümlü ve hover eyleminde de değişken özellikle yaparsanız daha güzel olur.

<ul>
<li><a href="#" onclick="select_PG(this); return false;" id="PG_1">Attachments, Adhesives, Sealants and Fixings </a></li>

<li><a href="#" onclick="select_PG(this); return false;" id="PG_2">Bogies, Suspension, Wheels and Axles </a></li>

<li><a href="#" onclick="select_PG(this); return false;" id="PG_3">Brakes, Couplers and Draw Gear </a></li>

<li><a href="#" onclick="select_PG(this); return false;" id="PG_4">Cables, Hoses and Connectors </a></li>

<li><a href="#" onclick="select_PG(this); return false;" id="PG_5">Computer Hardware and Software, Control and Monitoring Systems </a></li>

<li><a href="#" onclick="select_PG(this); return false;" id="PG_6">Controls, Electromechanical Equipment and Drives </a> </li>
</ul>





function select_PG(_element){
document.getElementById("productGroups_div").innerHTML+= _element.innerHTML+ " <br> ";
document.forms["mainForm"].productGroups.value+= _element.innerHTML+ " <br> ";

// _element.style.background="#CCCCCC";
_element.className ="PG_active"; //bu stil dosyamda veya satılarımda belirttiğim bi stil

}

function clear_PG(){
var i;
var _i="";
for(i=1;i<49;i++){
_i="PG_"+i;
document.getElementById(_i).className="";
}

document.getElementById("productGroups_div").innerHTML=" ";
document.forms["mainForm"].productGroups.value=" ";
}

No comments: