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 > เราจะใช้ link Named Anchor ใน iframe ยังไงครับให้มันไปยังตำแหน่งที่ต้องการ



 

เราจะใช้ link Named Anchor ใน iframe ยังไงครับให้มันไปยังตำแหน่งที่ต้องการ

 



Topic : 122966



โพสกระทู้ ( 316 )
บทความ ( 0 )



สถานะออฟไลน์




ขอสอบถามครับ ผมได้ทำการสร้าง iframe ไว้ที่หน้า index.php มา2ส่วน ส่วนบนดึงมาจากหน้า topmanu.php ส่วนล่างดึงข้อมูลมาจากหน้า main.php ผมจะทำยังไงให้กดเมนูที่ผมสร้างด้วย rollover image ให้ที่หน้า main.php ไปที่ตำแหน่งที่กดเลือก Named Anchor ไว้

topmanu.php

Code (PHP)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
</script>
</head>

<body onload="MM_preloadImages('images/Bu-home.png','images/Bu-product.png','images/Bu-contact.png')">
<table width="1280" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr align="left">
    <th width="128" align="center" scope="col">&nbsp;</th>
    <th width="163" bgcolor="#6B6D73" scope="col"><img src="images/GWE.png" width="163" height="91" /></th>
    <th width="406" bgcolor="#6B6D73" scope="col"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home','','images/Bu-home.png',1)"><img src="images/wh-home.png" width="106" height="40" id="home" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('product','','images/Bu-product.png',1)"><img src="images/wh-product.png" width="134" height="40" id="product" /></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('contact','','images/Bu-contact.png',1)"><img src="images/wh-contact.png" width="165" height="41" id="contact" /></a></th>
    <th width="453" valign="baseline" bgcolor="#6B6D73" scope="col">&nbsp;</th>
    <th width="129" valign="baseline" scope="col">&nbsp;</th>
  </tr>
</table>
</body>
</html>


main.php

Code (PHP)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
.GWE1 {
	font-weight: bold;
	color: #FFF;
}
.GWE2 {
	font-size: 10px;
}
.GWE2 {
	color: #FFF;
}
.GWE2 {
	font-family: "Browallia New";
}
.GWE2 {
	font-size: 14px;
}
.GWE2 {
	font-size: 16px;
}
</style>
</head>

<body>
<table width="1280" border="0" align="center" cellpadding="0" cellspacing="0"><form id="form1" name="form1" method="post" action="">
  <tr align="center" valign="top">
	<th width="128" scope="col">&nbsp;</th>
    <th colspan="3" align="center" valign="top"><img src="images/1.png" width="1024" height="445" /></th>
   	<th width="128" scope="col">&nbsp;</th>
  </tr>
  <tr>
    <th width="128" scope="col"><a name="product"></a></th>
    <th colspan="3" align="center" valign="top" scope="60%"><img src="images/17-5-59_03.png" width="1024" height="56" /></th>
    <th width="128" align="center" valign="top" scope="20%">&nbsp;</th>
  </tr>
  <tr>
    <th scope="col">&nbsp;</th>
    <th colspan="3" scope="100%"><table width="1023" border="0">
      <tr>
        <th scope="col"><img src="images/Web-page_11.png" width="269" height="216" /></th>
        <th scope="col"><img src="images/Web-page_12.png" width="269" height="216" /></th>
        <th scope="col"><img src="images/Web-page_14.png" width="297" height="216" /></th>
        </tr>
      <tr>
        <th scope="row">&nbsp;</th>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        </tr>
      </table></th>
    <th align="center" valign="top" scope="20%">&nbsp;</th>
  </tr>
  <tr>
    <th width="128" scope="col">&nbsp;</th>
    <th colspan="3" scope="100%">&nbsp;</th>
    <th width="128" align="center" valign="top" scope="20%">&nbsp;</th>
  </tr>
  <tr>
    <th width="128" scope="col">&nbsp;</th>
    <th width="67" height="10" bgcolor="#1b75b8" scope="100%">&nbsp;</th>
    <th height="40" colspan="2" align="left" bgcolor="#1b75b8" class="GWE1" scope="100%">บริษัท กรีน วอเตอร์ เอ็นจิเนี่ยริ่ง จำกัด</th>
    <th width="128" align="center" valign="top" scope="20%">&nbsp;</th>
  </tr>
  <tr>
    <th width="127" rowspan="8" scope="col">&nbsp;</th>
    <th bgcolor="#1b75b8" scope="100%">&nbsp;</th>
    <th height="30" colspan="2" align="left" valign="top" bgcolor="#1b75b8" class="GWE2" scope="100%">กรุณากรอกข้อมูลด้านล่าง เราจะทำการติดต่อกลับโดยเร็วที่สุด</th>
    <th width="128" rowspan="8" align="center" valign="top" scope="20%">&nbsp;</th>
  </tr>
  <tr>
    <th bgcolor="#1b75b8" scope="100%">&nbsp;</th>
    <th width="125" height="30" align="left" valign="top" bgcolor="#1b75b8" class="GWE2" scope="100%">ชื่อ </th>
    <th width="833" align="left" valign="top" bgcolor="#1b75b8" class="GWE2" scope="100%"><label for="name"></label>
      <input name="name" type="text" id="name" size="50" /></th>
  </tr>
  <tr>
    <th bgcolor="#1b75b8" scope="100%">&nbsp;</th>
    <th width="125" height="30" align="left" valign="top" bgcolor="#1b75b8" class="GWE2" scope="100%">โทรศัพท์</th>
    <th width="833" height="30" align="left" valign="top" bgcolor="#1b75b8" class="GWE2" scope="100%"><label for="tel"></label>
      <input name="tel" type="text" id="tel" size="10" /></th>
  </tr>
  <tr>
    <th bgcolor="#1b75b8" scope="100%">&nbsp;</th>
    <th width="125" height="30" align="left" valign="top" bgcolor="#1b75b8" class="GWE2" scope="100%">อีเมล</th>
    <th width="833" height="30" align="left" valign="top" bgcolor="#1b75b8" class="GWE2" scope="100%"><label for="email"></label>
      <input name="email" type="text" id="email" size="30" /></th>
  </tr>
  <tr>
    <th bgcolor="#1b75b8" scope="100%">&nbsp;</th>
    <th width="125" height="30" align="left" valign="top" bgcolor="#1b75b8" class="GWE2" scope="100%">สินค้าที่ท่านสนใจ</th>
    <th width="833" height="30" align="left" valign="top" bgcolor="#1b75b8" class="GWE2" scope="100%"><label for="product"></label>
      <select name="product" id="product">
      </select></th>
  </tr>
  <tr>
    <th bgcolor="#1b75b8" scope="100%">&nbsp;</th>
    <th width="125" height="30" align="left" valign="top" bgcolor="#1b75b8" class="GWE2" scope="100%">ข้อความ</th>
    <th width="833" height="30" align="left" valign="top" bgcolor="#1b75b8" class="GWE2" scope="100%"><label for="massage">
      <textarea name="massage" id="massage" cols="45" rows="5"></textarea>
    </label></th>
  </tr>
  <tr>
    <th bgcolor="#1b75b8" scope="100%">&nbsp;</th>
    <th width="125" height="30" align="left" bgcolor="#1b75b8" class="GWE2" scope="100%">&nbsp;</th>
    <th width="833" height="30" align="left" bgcolor="#1b75b8" class="GWE2" scope="100%">
    </th>
  </tr>
  <tr>
    <th bgcolor="#1b75b8" scope="100%">&nbsp;</th>
    <th height="30" colspan="2" align="left" bgcolor="#1b75b8" scope="100%">&nbsp;</th>
  </tr>
</form></table>
</body>
</html>




Tag : PHP, MySQL







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2016-05-17 21:21:29 By : karurub View : 795 Reply : 2
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

Link
<a href="#name">Link</a>


JavaScript
<a href="#" OnClick="window.location='#name';">Link</a>







แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2016-05-18 09:42:53 By : mr.win
 


 

No. 2



โพสกระทู้ ( 316 )
บทความ ( 0 )



สถานะออฟไลน์


ตอบความคิดเห็นที่ : 1 เขียนโดย : mr.win เมื่อวันที่ 2016-05-18 09:42:53
รายละเอียดของการตอบ ::
<a href="#name">Link</a> เอาไปใส่ใน topmanu.php
<a href="#" OnClick="window.location='#name';">Link</a> เอาไปใส่ main.php

ลองแล้วไม่มีไรเกิดขึ้น

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2016-05-18 11:29:07 By : karurub
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : เราจะใช้ link Named Anchor ใน iframe ยังไงครับให้มันไปยังตำแหน่งที่ต้องการ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ 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 อัตราราคา คลิกที่นี่