เอาเมาส์ไปวางแล้วสีเปลี่ยน ทำยังไงหรอครับ

เริ่มโดย mikeyx, 11 เมษายน 2008, 14:16:16

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

mikeyx

http://www.net-com.co.th/2005/th/home/index.php

ประมาณนี้ครับเขาใช้เทคนิคอะไรทำ ???

EThaiZone

ก็ css ไงครับ  ???

/*ลิงค์ปกติ*/
a:link { color:#0000FF; text-decoration:none }

/*ลิงค์เข้าชมแล้ว*/
a:visited { color:#0000FF; text-decoration:none }

/*ลิงค์ที่กำลังถูกกด*/
a:active { color:#FF9900; text-decoration:none }

/*ลิงค์ที่เมาส์กำลังอยู่เหนือลิงค์*/
a:hover { color:#FF9900; text-decoration:none }

mikeyx

คือเปลี่ยนสีทั้งเวบเลยนะครับ

อันนั้นมันลิงค์เฉย ๆไม่ใช่หรอครับ
คือที่ผมต้องการคือ เปลี่ยนสี เวบเลยอะ
แบบ yahoo

EThaiZone

อ้อ เพิ่งสังเกต

ลองดูโค้ดเหล่านี้ประกอบ ก็น่าจะเก็ทนะครับ


//ส่วนแรก อยู่ใน head
<link href="../../css/style1.css" rel="stylesheet" type="text/css">
<link href="../../css/style2.css" rel="stylesheet" type="text/css">
<link href="../../css/style3.css" rel="stylesheet" type="text/css">
<link href="../../css/style4.css" rel="stylesheet" type="text/css">
<link href="../../css/style5.css" rel="stylesheet" type="text/css">

//ส่วนสองเป็นจาวาสคริป
function changeSheets(whichSheet){
  whichSheet=whichSheet-1;
  if(document.styleSheets){
var c = document.styleSheets.length;
for(var i=1;i<c;i++){
  if(i!=whichSheet){
document.styleSheets[i].disabled=true;
  }else{
document.styleSheets[i].disabled=false;
  }
}
  }
}

//ส่วนสามอยู่ใน body ที่เป็นจุดใช้เปลี่ยนสี
          <td width="22"><a href="?act=setColor&color=1"><img src="../../images/color1.gif" width="14" height="14" border="0" onMouseOver="changeSheets(1)"></a></td>
          <td width="22"><a href="?act=setColor&color=2"><img src="../../images/color2.gif" width="14" height="14" border="0" onMouseOver="changeSheets(2)"></a></td>
          <td width="22"><a href="?act=setColor&color=3"><img src="../../images/color3.gif" width="14" height="14" border="0" onMouseOver="changeSheets(3)"></a></td>
          <td width="22"><a href="?act=setColor&color=4"><img src="../../images/color4.gif" width="14" height="14" border="0" onMouseOver="changeSheets(4)"></a></td>
          <td width="22"><a href="?act=setColor&color=5"><img src="../../images/color5.gif" width="14" height="14" border="0" onMouseOver="changeSheets(5)"></a></td>


เทคนิคเข็มขัดสั้นนะเนี่ย  :P

mikeyx

ขอบคุณครับเข็ดขัดสั้นอีกและ ผมคิดมากไปเอง เอิ๊ก ๆๆ

jiw

เข้ามาตอบไม่ทัน 55+


ถ้าเป็นผม ผมก็แนวๆข้างบน ... ใช้  java script แล้วก็ onChange ไปเลย


เป็นความรู้ที่ได้จากการเรียนมา ^^

ฉันไม่มีตัวตน

ขอบคุณครับขอรับไปเลยละกัน

ปล.ยังใจดีเหมือนเดิม :-*

Dr.K

[direct=https://www.thaihealth.net/blog/seo_doctor/]seo blog[/direct]|[direct=https://netplushost.com]netplushost[/direct]
[direct=https://pattayawebmarketing.com/pattaya-seo]pattaya seo[/direct]
[direct=https://dochost.net]seo hosting[/direct]