|
 |
|
Javascript ไม่ทำงาน ผมเขียนโค้ดขยายรูปภาพด้วย Javascript พอลองใช้กับ IE 7 ขึ้นไปใช้ได้ |
|
 |
|
|
 |
 |
|
ผมเขียนโค้ดขยายรูปภาพด้วย Javascript พอลองใช้กับ IE 7 ขึ้นไปใช้ได้ แต่พอลองกับ Firefox,Opera,Chrome ไม่ได้ผลครับ ทำไงดี
Code (PHP)
<?
include "connect.php";
if(!isset($start)){
$start = 0;
}
$limit = '1'; // แสดงผลหน้าละกี่หัวข้อ
$res2=mysql_query("select * from file where store_id=$store_id and type_file =$type_file and type_id=$type_id and status_file ='show' order by file_id ");
$res=mysql_query("select * from file where store_id=$store_id and type_file =$type_file and type_id=$type_id and status_file ='show' order by file_id LIMIT $start,$limit ");
$num=mysql_num_rows($res2);
$date=date("d/m/Y");
$time=date("H:i:s");
while($data=mysql_fetch_array($res)){
$file=$data['file_name'];
$res2=mysql_query("insert into logfile values('','$permission_id','$sess_id','$data[file_id]','$date','$time')");
$size=GetimageSize("file/$file");
$img_width = (int)$size[0];
$img_height = (int)$size[1];
?>
<script language="javascript">
var zoomfactor=0.05 //Enter factor (0.05=5%)
function zoomhelper(){
if (parseInt(whatcache.style.width)>10&&parseInt(whatcache.style.height)>10){
whatcache.style.width=parseInt(whatcache.style.width)+parseInt(whatcache.style.width)*zoomfactor*prefix
whatcache.style.height=parseInt(whatcache.style.height)+parseInt(whatcache.style.height)*zoomfactor*prefix
}
}
function zoom(originalW, originalH, what, state){
if (!document.all&&!document.getElementById)
return
whatcache=eval("document.images."+what)
prefix=(state=="in")? 1 : -1
if (whatcache.style.width==""||state=="restore"){
whatcache.style.width=originalW
whatcache.style.height=originalH
if (state=="restore")
return
}
else{
zoomhelper()
}
clearInterval(beginzoom)
beginzoom=setInterval("zoomhelper()",100)
}
</script>
<a href="#" onclick="zoom(<?=$img_width?>,<?=$img_height ?>,'f','in')" ><img src="images/zoom_in3.png" border="0" /></a> |
<a href="#" onclick="zoom(<?=$img_width?>,<?=$img_height ?>,'f','restore')"><img src="images/refresh.png" border="0" /></a> |
<a href="#" onclick="zoom(<?=$img_width?>,<?=$img_height ?>,'f','out')" ><img src="images/zoom_out3.png" border="0" /></a>
<div>
<?
$page = ceil($num/$limit); // เอา record ทั้งหมด หารด้วย จำนวนที่จะแสดงของแต่ละหน้า
/* เอาผลหาร มาวน เป็นตัวเลข เรียงกัน เช่น สมมุติว่าหารได้ 3 เอามาวลก็จะได้ 1 2 3 */
echo "<br><center>";
for($m=1;$m<=$page;$m++){
if($_GET['page']==$m){ //ถ้าตัวแปล page ตรง กับ เลขที่วนได้
echo "
<a href='?start=".$limit*($m-1)."&page=$m&store_id=$store_id&type_file=$type_file&type_id=$type_id&permission_id=$permission_id' class='mynavi'><font color='#FFFFFF'><B>$m</B></font></A>"; //ลิ้งค์ แบ่งหน้า เงื่อนไขที่ 1
}else{
echo "
<a href='?start=".$limit*($m-1)."&page=$m&store_id=$store_id&type_file=$type_file&type_id=$type_id&permission_id=$permission_id' class='mynavi'>$m</A>"; //ลิ้งค์ แบ่งหน้า เงื่อนไขที่ 2
}
}
echo "</center><br><br>";
echo "<img name='f$i' src='file/$file' width='$img_width' ismap='ismap' /><br><br>";
?>
</div>
<?
$i++;
}
?>
รบกวนช่วยผมที
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2010-06-22 09:59:38 |
By :
phannack |
View :
1467 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
วางสคลิปไว้ผิดที่หรือป่าวครับ 
|
 |
 |
 |
 |
Date :
2010-07-19 09:19:09 |
By :
itzone |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คุณใช้ firebug หรือเปล่าครับถ้าใช้จะเช็คได้ว่ามันพลาดตรงไหนคัรบ
|
 |
 |
 |
 |
Date :
2010-07-19 10:47:12 |
By :
oxygenyoyo |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 05
|