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 > Client Script Forum > เขาทำให้ข้อมูลสลับไปมาเหมือน วนลูบยังไงหรอครับ มี ตย ด้านในครับ



 

เขาทำให้ข้อมูลสลับไปมาเหมือน วนลูบยังไงหรอครับ มี ตย ด้านในครับ

 



Topic : 053088



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



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



คือจะทำตอน คนทีขอเพลง เข้ามาแล้วให้ ข้อความที่ข้อเพลง มันสลับไปสลับมา คล้ายๆ กับวน ลูบ ผม แก่ะโค้ดจากเว็บนี้ หลายครั้งแล้วครับ
ใครพอจะมีทริป ที่มีพื้นฐานคล้ายๆเจ้าตัวนี้ก็แน่ะนำหน่อยน่ะครับ



ดูตัวอย่างตรงนี้ครับ <-- ดูตัวอย่างก่อนครับจะเข้าใจเลย

รู้สึกว่าจะมี java มาช่วยครับ

Code (JavaScript)

<SCRIPT language=JavaScript type=text/javascript>
				//<!-- 
				document.write ("<script language='JavaScript' type='text/javascript' src='show.php'></script>");
				//-->
			</SCRIPT>
สังเกต ตรง show.php


อันนี้ โค้ดในไฟล์ show.php อ่ะครับ ผมแก่ะ เป็นไฟล์โชว์รายชื่อเพลงที่วนลูบอ่ะครับอยากได้ๆ ไม่รู้จะแทนตัวแแปรยังไง ไปก๊อบมาให้ดูอ่ะครับเผื่อใครพอมีแนะนำแนวทางทำได้บ้าง

Code (JavaScript)

/*
Fading Scroller- By DynamicDrive.com
For full source code, and usage terms, visit http://www.dynamicdrive.com
This notice MUST stay intact for use
*/

var delay=3000 //set delay between message change (in miliseconds)
var fcontent=new Array()
begintag='<font face="tahoma" size="2">' //set opening tag, such as font declarations

fcontent[0] = "<a title=อยู่ีคนเดียว ของ เบิร์ด&nbsp;&nbsp;โดย&nbsp;&nbsp;ไก่ href=#><font color=#FE4871>อยู่ีคนเดียว ของ เบิร์ด</font>&nbsp;&nbsp;<font color=#3A9900>โดย</font>&nbsp;&nbsp;<font color=#006CFF>ไก่</font></a>"


fcontent[1] = "<a title=อะไรก็ได้ในใจเธอ ของ บีโอวาย&nbsp;&nbsp;โดย&nbsp;&nbsp;เตอร์ href=#><font color=#FE4871>อะไรก็ได้ในใจเธอ ของ บีโอวาย</font>&nbsp;&nbsp;<font color=#3A9900>โดย</font>&nbsp;&nbsp;<font color=#006CFF>เตอร์</font></a>"


closetag='</font>'

var fwidth=678 //set scroller width
var fheight=15 //set scroller height

var fadescheme=0 //set 0 to fade text color from (white to black), 1 for (black to white)
var fadelinks=1  //should links inside scroller content also fade like text? 0 for no, 1 for yes.

///No need to edit below this line/////////////////

var hex=(fadescheme==0)? 255 : 0
var startcolor=(fadescheme==0)? "rgb(255,255,255)" : "rgb(0,0,0)"
var endcolor=(fadescheme==0)? "rgb(0,0,0)" : "rgb(255,255,255)"

var ie4=document.all&&!document.getElementById
var ns4=document.layers
var DOM2=document.getElementById
var faderdelay=0
var index=0

if (DOM2)
faderdelay=2000

//function to change content
function changecontent(){
if (index>=fcontent.length)
index=0
if (DOM2){
document.getElementById("fscroller").style.color=startcolor
document.getElementById("fscroller").innerHTML=begintag+fcontent[index]+closetag
linksobj=document.getElementById("fscroller").getElementsByTagName("A")
if (fadelinks)
linkcolorchange(linksobj)
colorfade()
}
else if (ie4)
document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag
else if (ns4){
document.fscrollerns.document.fscrollerns_sub.document.write(begintag+fcontent[index]+closetag)
document.fscrollerns.document.fscrollerns_sub.document.close()
}

index++
setTimeout("changecontent()",delay+faderdelay)
}

// colorfade() partially by Marcio Galli for Netscape Communications.  ////////////
// Modified by Dynamicdrive.com

frame=20;

function linkcolorchange(obj){
if (obj.length>0){
for (i=0;i<obj.length;i++)
obj[i].style.color="rgb("+hex+","+hex+","+hex+")"
}
}

function colorfade() {	         	
// 20 frames fading process
if(frame>0) {	
hex=(fadescheme==0)? hex-12 : hex+12 // increase or decrease color value depd on fadescheme
document.getElementById("fscroller").style.color="rgb("+hex+","+hex+","+hex+")"; // Set color value.
if (fadelinks)
linkcolorchange(linksobj)
frame--;
setTimeout("colorfade()",20);	
}

else{
document.getElementById("fscroller").style.color=endcolor;
frame=20;
hex=(fadescheme==0)? 255 : 0
}   
}

if (ie4||DOM2)
document.write('<div id="fscroller" style="padding:1px;font-size: 7pt;"></div>')

window.onload=changecontent



ขอบคุณอีกครั้งครับ



Tag : - - - -









ประวัติการแก้ไข
2010-12-13 22:13:28
Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2010-12-13 22:09:42 By : siamyim View : 1231 Reply : 1
 

 

No. 1

Guest


fcontent[1] = "<a title=อะไรก็ได้ในใจเธอ ของ บีโอวาย&nbsp;&nbsp;โดย&nbsp;&nbsp;เตอร์ href=#><font color=#FE4871>อะไรก็ได้ในใจเธอ ของ บีโอวาย</font>&nbsp;&nbsp;<font color=#3A9900>โดย</font>&nbsp;&nbsp;<font color=#006CFF>เตอร์</font></a>"

fcontent[1] เป็น array อยู่แล้วครับ เพิ่มได้ตามจำนวนเพลงที่ขอมา เช่น

fcontent[2] = "<a href="#">ชื่อเพลง ก</a>";
fcontent[3] = "<a href="#">ชื่อเพลง ข</a>";


เมื่อมีการ post ข้อมูลการขอเพลง ก็ store ลง database หรือเขียนลงเป็นไฟล์ก็ได้แล้วแต่ถนัด

จากนั้นก็แก้ไขไฟล์ show.php ที่อุตสาหะ ศึกษามา

ตรง fcontent[0] array ก็เขียน script ดึงข้อมูลเพลงที่ขอมา สร้างเป็น array โดยแทรก tag php เข้าไป ตัวอย่าง เพื่อให้ Dynamics

-
-
-
<?php

ลูปดึงข้อมูล จาก Database

echo "fcontent[".$index."] = "\"<a href=\"#\">".$songName."</a>" ;

?>
-
-
-
-
หลักการก็ประมาณนี้ ลองทำดูครับ






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2010-12-17 09:10:56 By : mandy
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
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 02
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 อัตราราคา คลิกที่นี่