Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > เวลาเอาเม้าท์คลิกมันจะ โชว์เฉพาะในกลุ่ม ช่วยสอนวิธีหน่อยได้ไหมคะ



 

เวลาเอาเม้าท์คลิกมันจะ โชว์เฉพาะในกลุ่ม ช่วยสอนวิธีหน่อยได้ไหมคะ

 



Topic : 021084

Guest




ใครทำเมนูแบบนี้ได้มั่งคะ ช่วยสอนวิธีหน่อยได้ไหมคะ ว่าทำยังไง เวลาเอาเม้าท์คลิกมันจะ โชว์เฉพาะในกลุ่ม ใครทำเมนูแบบนี้ได้มั่งคะ ช่วยสอนวิธีหน่อยได้ไหมคะ ว่าทำยังไง เวลาเอาเม้าท์คลิกมันจะ โชว์เฉพาะในกลุ่ม



ใครทำเมนูแบบนี้ได้มั่งคะ ช่วยสอนวิธีหน่อยได้ไหมคะ ว่าทำยังไง เวลาเอาเม้าท์คลิกมันจะ โชว์เฉพาะในกลุ่ม ถ้าไปเลือกหัวข้ออื่น มันจะโชว์ เฉพาะกลุ่ม เมนูเดิม มันจะหดเอง

หนูลองทำแล้ว มันยังไม่เวิค อ่ะค่ะ อันนี้ลองทำ แต่มันหดอันเดียวเองใครทำเมนูแบบนี้ได้มั่งคะ ช่วยสอนวิธีหน่อยได้ไหมคะ ว่าทำยังไง เวลาเอาเม้าท์คลิกมันจะ โชว์เฉพาะในกลุ่ม ถ้าไปเลือกหัวข้ออื่น มันจะโชว์ เฉพาะกลุ่ม เมนูเดิม มันจะหดเอง
หนูลองทำแล้ว มันยังไม่เวิค ค่า


อันนี้ลองทำแต่มันไม่ถูกค่า ช่วยดูให้หน่อยคะ

<script language="JavaScript">
var enablepersist="off" //Enable saving state of content structure using session cookies? (on/off)

var collapseprevious="yes" //Collapse previously open content when opening present? (yes/no)



if (document.getElementById){

document.write('<style type="text/css">')

document.write('.link{display:none;}')

document.write('</style>')

}



function getElementbyClass(classname){

ccollect=new Array()

var inc=0

var alltags=document.all? document.all : document.getElementsByTagName("*")

for (i=0; i<alltags.length; i++){

if (alltags.className==classname)

ccollect[inc++]=alltags

}

}



function contractcontent(omit){

var inc=0

while (ccollect[inc]){

if (ccollect[inc].id!=omit)

ccollect[inc].style.display="none"

inc++

}

}



function expandcontent(cid){

if (typeof ccollect!="undefined"){

if (collapseprevious=="yes")

contractcontent(cid)

document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"

}

}



function revivecontent(){

contractcontent("omitnothing")

selectedItem=getselectedItem()

selectedComponents=selectedItem.split("|")

for (i=0; i<selectedComponents.length-1; i++)

document.getElementById(selectedComponents).style.display="block"

}



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 getselectedItem(){

if (get_cookie(window.location.pathname) != ""){

selectedItem=get_cookie(window.location.pathname)

return selectedItem

}

else

return ""

}



function saveswitchstate(){

var inc=0, selectedItem=""

while (ccollect[inc]){

if (ccollect[inc].style.display=="block")

selectedItem+=ccollect[inc].id+"|"

inc++

}



document.cookie=window.location.pathname+"="+selectedItem

}



function do_onload(){

getElementbyClass("link")

if (enablepersist=="on" && typeof ccollect!="undefined")

revivecontent()

}





if (window.addEventListener)

window.addEventListener("load", do_onload, false)

else if (window.attachEvent)

window.attachEvent("onload", do_onload)

else if (document.getElementById)

window.onload=do_onload



if (enablepersist=="on" && document.getElementById)

window.onunload=saveswitchstate
</script>
<table width="200" border="1" cellspacing="0" cellpadding="0">
<?php
include ("connectdb2.php");
$query="select * from category";
$result=mysql_query($query)or die("query eror");
while ($row=mysql_fetch_array ($result)) {
?>
<tr>
<td><a href="#" onclick="expandcontent('menu')"><?php echo $row["name"]; ?></a></td>
</tr>
<tr>
<td><div id="menu" class="link"><table width="200" border="1" cellspacing="0" cellpadding="0">
<tr>
<td>sub 1</td>
</tr>
<tr>
<td>sub 2</td>
</tr>
<tr>
<td>sub 3</td>
</tr>
</table></div></td>
</tr>
<?php } ?>
</table>


















Tag : - - - -







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 18 ก.ค. 2551 15:51:44 By : แพนเค้ก View : 1314 Reply : 0
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : เวลาเอาเม้าท์คลิกมันจะ โชว์เฉพาะในกลุ่ม ช่วยสอนวิธีหน่อยได้ไหมคะ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 04
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่