Wednesday 15 September 2010

Blog တြင္ ဘာဂ်ာေခါက္ ေခါင္းစဥ္ငယ္လုပ္ခ်င္ရင္

 ဟုတ္လားမဟုတ္လားေတာ့မသိဘူး။ ဘာဂ်ာေခါက္ပုံစံလုိ႔ ေပးလုိက္ျပီ။ smileလာေမးသူေတြအားလုံးအဆင္ေျပေအာင္ ဒီေနရာကေနဘဲ တင္လုိက္ပါတယ္။ ဘယ္မွာလုိက္ ေျပာရမွန္း မသိတာနဲ႔ပါ။ ဒီကုဒ့္ေတြကုိ ကုိခ်မ္းျမစုိး စာမ်က္ႏွာမွာ သုံးစဥ္အခါက ကၽြန္ေတာ္လည္းသုံးမ လုိ႔ဘဲ။ သူကုိေမးဖုိ႔ လုပ္ေနတုန္း သူက တန္းပလတ္ေျပာင္း လုိက္လုိ႔ မေမးျဖစ္ခဲ့ဘူး။ ေနာက္မွ ကုိယ္သိမ္း ထားခဲ့တဲ့ သူ႔ရဲ႕ကုဒ့္ေတြကုိ သတိရတာ နဲ႔ျပန္ၾကည့္ျပီး ဟုိျပင္ဒီျပင္ နည္းနည္းလုပ္ျပီးေတာ့ တင္ထားလုိက္တာဘဲ။ သူကုိယူသုံးဖုိ႔ေျပာေတာ့ ရတယ္ဆုိတာနဲ႔ ကၽြန္ေတာ္ စာမ်က္ႏွာမွာ တင္ထားလုိက္တာပါ။ နမႈနာ ၾကည့္ခ်င္ရင္ေတာ့ ကၽြန္ေတာ္ စာမ်က္ႏွာရဲ႕ ေဘးေခါင္းစဥ္ငယ္ မ်ားေနရာမွာ
စိတ္၀င္စားဖြယ္ ကြန္ရက္မ်ား
ဆုိျပီးရွိပါတယ္။
ဘယ္လုိလုပ္လဲဆုိရင္ေတာ့ ....

ပထမ <head> ရဲ႕ေနာက္ ဒါမွမဟုတ္ မဆုံးခင္ၾကားထဲမွာ





<style type='text/css'>
.menutitle{
cursor:pointer;
margin-bottom: 5px;
background-color:#ECECFF; မိမိထားခ်င္ေသာေနာက္ခံအေရာင္
color:#000000; မိမိထားခ်င္ေသာ စာသားအေရာင္
width:305px; မိမိထားခ်င္ေသာဆုိဒ့္ကုိျပင္ရန္
font-family: "ZawGyi-One", ZawgyiOne, Zawgyi1, Trebuchet MS, Trebuchet, arial, verdana, sans-serif;
padding:2px;
text-align:center;
font-weight:normal;
/*/*/border:1px solid #000000;/* */
}

.submenu{
margin-bottom: 0.5em;
font-family: "ZawGyi-One", ZawgyiOne, Zawgyi1, Trebuchet MS, Trebuchet, arial, verdana, sans-serif;
}
</style>


<script type='text/javascript'>
//<![CDATA[
var persistmenu="yes" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only

if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
 if(document.getElementById){
 var el = document.getElementById(obj);
 var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
  if(el.style.display != "block"){ //DynamicDrive.com change
   for (var i=0; i<ar.length ; i++){
    if (ar[i].className=="submenu") //DynamicDrive.com change
    ar[i].style.display = "none";
   }
   el.style.display = "block";
  }else{
   el.style.display = "none";
  }
 }
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function onloadfunction(){
if (persistmenu=="yes"){
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=get_cookie(cookiename)
if (cookievalue!="")
document.getElementById(cookievalue).style.display="block"
}
}

function savemenustate(){
var inc=1, blockid=""
while (document.getElementById("sub"+inc)){
if (document.getElementById("sub"+inc).style.display=="block"){
blockid="sub"+inc
break
}
inc++
}
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
document.cookie=cookiename+"="+cookievalue
}

if (window.addEventListener)
window.addEventListener ("load", onloadfunction, false)
else if (window.attachEvent)
window.attachEvent("onload", onloadfunction)
else if (document.getElementById)
window.onload=onloadfunction

if (persistmenu=="yes" && document.getElementById)
window.onunload=savemenustate
//]]>
</script><style type='text/css'>
.submenu{display: none;}
</style>

ကုိထည့္ပါ။ ျပီးရင္ထားခ်င္ေသာေနရာမွာ

<div id="masterdiv">

    <div class="menutitle" onclick="SwitchMenu('sub1')"><span>မိမိေပးခ်င္ေသာေခါင္းစဥ္ခြဲ</span></div>
    <span id="sub1" class="submenu">
        » <a href="မိမိတင္ခ်င္ေသာလိပ္စာ" target="_blank">မိမိတင္ထားေသာလိပ္စာ၏နာမည္<br/>
ေနာက္ထပ္ထည့္ခ်င္ရင္ ဒီ
  » <a href="မိမိတင္ခ်င္ေသာလိပ္စာ" target="_blank">မိမိတင္ထားေသာလိပ္စာ၏နာမည္<br/>
တေၾကာင္းလုံးကုိျပန္ copy ကူးထည့္ရင္ရပါျပီ။
 ကုိယ္က ေခါင္းစဥ္ထပ္လုပ္ခ်င္ေသးရင္ sub1 ဆုိတဲ့ေနရာကုိ sub2 လုိ႔ အစဥ္လုိက္ေျပာင္းေပးျပီး၊လုပ္ရင္ ေနာက္ထပ္ေခါင္းစဥ္ခြဲေတြကုိယ္လုိသေလာက္ထပ္ထည့္ႏုိင္ပါတယ္။
 အဲဒီမွာေျပာဖုိ႔က်န္ေသးတာက
 <div id="masterdiv">
ေအာက္မွာရွိတဲ့ေခါင္းစဥ္ငယ္ေတြ sub1, sub2, sub3, sub4 ေပးထားခဲ့မိ ရင္ ကုိယ္ ေနာက္ထပ္လုပ္မဲ့၊
  <div id="masterdiv">
 မွာ  sub1, sub2, sub3, sub4 အစား  subA, subB, subC, subD လုိ႔ ေျပာင္းေပးဖုိ႔ လုိအပ္ပါလိမ့္မယ္။
 ဒါမွမဟုတ္ ကုိယ္က ဒီဘက္ႏွိပ္၊ ေပၚတာက ဟုိဘက္ကျဖစ္ေနပါလိမ့္မယ္။ ဒါကုိသတိထားလုိက္ရင္အဆင္ေျပပါတယ္။

0 comments:

Post a Comment