ThaiSEOBoard.com

พัฒนาเว็บไซต์ => Programming => ข้อความที่เริ่มโดย: itsstone ที่ 06 กุมภาพันธ์ 2013, 23:55:07



หัวข้อ: ถามเทพสคริป : java มีค่าตอบแทนให้ครับ
เริ่มหัวข้อโดย: itsstone ที่ 06 กุมภาพันธ์ 2013, 23:55:07
ถ้าต้องการให้แบนเนอร์โชว์ และมี text ให้กดลิงค์ไปได้ อยู่มุมขวาด้านล่าง banner เหมือน นิภา บัมคิว หรือ adsense  ต้องทำอย่างไรรึครับ

สคริปต้นฉบับเป็นแบบนี้ครับ [เรียกโชว์แบนเนอร์]

<script type="text/javascript">
   var destlink = ["http://localhost/media/click.php?bid=1", "http://localhost/media/click.php?bid=2"];
   var imglink = ["http://localhost/media/track/tracker.php?bid=1", "http://localhost/media/track/tracker.php?bid=2"];
   var index = Math.floor(Math.random() * destlink.length);
   var ads = '<a href="'  destlink[index]   '">'   '<img src='   imglink[index]   ' />'   '</a>';
   document.write(ads);
</script>

หากใครทำได้คิดค่าเหนื่อยแจ้ง PM ได้เลยนะครับ

ขอบคุณครับ


หัวข้อ: Re: ถามเทพสคริป : java มีค่าตอบแทนให้ครับ
เริ่มหัวข้อโดย: pkr4life ที่ 10 กุมภาพันธ์ 2013, 14:02:43
พอได้เป่า

โค๊ด:
        <script type="text/javascript">

            var destLink = new Array();
            destLink.push("http://localhost/media/click.php?bid=1");
            destLink.push("http://localhost/media/click.php?bid=2");

            var imgLink = new Array();
            imgLink.push("http://www.thaiseoboard.com/Themes/thaiseoboard_rev2009/images/pr1.jpg");
            imgLink.push("http://www.thaiseoboard.com/Themes/thaiseoboard_rev2009/images/pr2.jpg");

            var index = Math.floor(Math.random() * destLink.length);

            var ads = "<div align='right'>";
            ads  = "<a href='"   destLink[index]   "'><img src='"   imgLink[index]   "'/></a>";
            ads  = "<br><a href='"   destLink[index]   "'>Click</a>";
            ads  = "</div>";
            document.write(ads);

        </script>