May
hide menu from dropdownmenu
i am newbie in asp.net programming :funnyup
my problem was:
[objective] : to hide menu from the javascript dropdownmenu
[control] : 2 user, 1 as admin and another as user …
[introduction] : use same webpage, namely mainpage.aspx with js dropdownmenu
[problem] some of the links in the dropdownmenu were for Admin …
how to implement javascript that can differentiate the user… If-Else ?
helpp..
my boss said that, we can hide the menu from the dropdownmenu list according to the user access level, that is ‘admin’ and ‘user’
this is the dropdownmenu JS
<td width=“50″><ul id=“sddm”>
<li><a href=“#” onmouseover=“mopen(’m1′)” onmouseout=“mclosetime()”>Pengguna </a>
<div id=“m1″ onmouseover=“mcancelclosetime()” onmouseout=“mclosetime()”> <a href=“#”>Ubah Kata Laluan </a> <a href=“#”>Tambah Pengguna </a> <a href=“#”>Hapus Pengguna </a> </div>
</li>
<li><a href=“#” onmouseover=“mopen(’m3′)” onmouseout=“mclosetime()”>Rekod Kursus </a>
<div id=“m3″ onmouseover=“mcancelclosetime()” onmouseout=“mclosetime()”> <a href=“kursustambah.aspx”>Tambah Rekod Kursus</a> <a href=“pesertatambah.aspx”>Tambah Rekod Peserta</a> <a href=“kursuskemaskinicari.aspx”>Kemaskini Rekod Kursus</a> <a href=“kursushapus.aspx”>Hapus Rekod Kursus</a> </div>
</li>
<li><a href=“kajiselidik.aspx” onmouseover=“mopen(’m4′)” onmouseout=“mclosetime()”>Kaji Selidik </a>
</li>
<li><a href=“datacari.aspx” onmouseover=“mopen(’m4′)” onmouseout=“mclosetime()”>Cari Data </a></li>
<li><a href=“#” onmouseover=“mopen(’m5′)” onmouseout=“mclosetime()”>Laporan</a>
<div id=“m5″ onmouseover=“mcancelclosetime()” onmouseout=“mclosetime()”><a href=“laporankursuscari.aspx”>Laporan Rekod Kursus</a> <a href=“laporankursusbln.aspx”>Laporan Kursus Bulanan & Tahunan</a> <a href = “laporankursuscari.aspx”>Laporan Senarai Peserta</a></div>
</li>
<li><a href=“#” onmouseover=“mopen(’m6′)” onmouseout=“mclosetime()”>Keluar</a></li>
</ul> <p></p></td>
</tr>
</table>
=======================
default.
css
#sddm
{
margin: 0;
padding: 0;
z-index: 300;
left: 45px;
top: 274px;
width: 920px;
}
#sddm li
{ margin: 0;
padding: 0;
list-style: none;
float: left;
font: bold 11px arial}
#sddm li a
{ display: block;
margin: 0 1px 0 0;
padding: 4px 10px;
width: 110px;
background: #5970B2;
color: #FFF;
text-align: center;
text-decoration: none}
#sddm li a:hover
{ background: #49A3FF}
#sddm div
{ position: absolute;
visibility: hidden;
margin: 0;
width: 130px;
padding: 0;
background: #EAEBD8;
border: 1px solid #5970B2}
#sddm div a
{ position: relative;
display: block;
margin: 0;
padding: 5px 10px;
width: auto;
white-space: nowrap;
text-align: left;
text-decoration: none;
background: #EAEBD8;
color: #2875DE;
font: 11px arial}
#sddm div a:hover
{ background: #49A3FF;
color: #FFF}
Relevant Links

