โค้ดโฆษณา Banner เลื่อน ขึ้น-ลง ตาม Scrollbar

สำหรับเว็บมาสเตอร์ที่อยากจะเพิ่มช่องทางการทำเงินด้วยป้ายโฆษณาที่สามารถเลื่อน ขึ้น-ลง ตามการเลื่อนเม้าส์ Scroll Bar เพื่อให้ป้ายแบนเนอร์โฆษณาดูโดดเด่นเห็นได้ชัดเจน วันนี้ผมมีโค้ดมาแจกครับ สามารถนำค่าเดิม ๆ ไปเปลี่ยนเป็นป้ายแบนเนอร์ของคุณได้เลย หรือจะปรับแต่งตามความต้องการก็ย่อมได้

โค้ด HTML ที่นำมาแจกนี้ สามารถนำไปใช้กับระบบของ Blogger หรือเว็บไซต์อื่น ๆ ที่ไม่มี Base CSS นะครับ ส่วนตัวผมทดสอบใช้งานกับ Blogger แล้วไม่มีปัญหาใด ๆ ใช้งานได้ปกติ

โค้ดจะมีด้วยกัน 3 ชุด สามารถเลือกอย่างใดอย่างหนึ่งไปใช้งานตามความเหมาะสมของเว็บไซต์คุณได้เลย

หมายเหตุ: ขนาดป้ายโฆษณา 160x600 สามารถเปลี่ยนขนาดของป้ายได้ ให้ค้นหาโค้ด width="160 และ height="600 เปลี่ยนที่ตัวเลข 160 และ 600 เป็นความกว้างความสูงตามที่เราต้องการ


1. คลิกไปที่ แม่แบบ แล้วคลิก แก้ไข HTML


2. ค้นหาโค้ด </body> วางโค้ดแบนเนอร์ก่อน </body> แล้วคลิก บันทึกเทมเพลต



1. โค้ดเลื่อนตาม Scrollbar ทางซ้าย
<style>   
.white_content1 {
position: fixed;
left: 29px;
z-index: 1030;
top: 5px;
padding: 2px;
background-color: white;
-webkit-box-shadow: 0 0 20px 4px #000000;
box-shadow: 0 0 0px 0px #000000;
}
</style>

<div class='white_content1' id='light1' style='display: block;'>
<p style='text-align: right;'>ปิดโฆษณานี้<a href='javascript:void(0)' onclick='document.getElementById(&apos;light1&apos;).style.display=&apos;none&apos;'><img height='13' src='http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/32/Actions-window-close-icon.png' width='13'/></a></p>
&lt;a href=&quot;ใส่ลิงก์ URL ของแบนเนอร์&quot; target=&quot;_blank&quot;&gt;&lt;img width=&quot;160&quot; border=&quot;0&quot; height=&quot;600&quot; src=&quot;ใส่ URL รูปภาพแบนเนอร์&quot; style=&quot;padding-bottom: 0px; padding-right: 0px; border-bottom-width: 0px; margin-bottom: -6px;&quot;&gt;&lt;/a&gt;
</div>


2. โค้ดเลื่อนตาม Scrollbar ทางขวา
<style>   
.white_content2 {
position: fixed;
right: 29px;
z-index: 1030;
top: 5px;
padding: 2px;
background-color: white;
-webkit-box-shadow: 0 0 20px 4px #000000;
box-shadow: 0 0 0px 0px #000000;
}
</style>

<div class='white_content2' id='light2' style='display: block;'>
<p style='text-align: right;'>ปิดโฆษณานี้<a href='javascript:void(0)' onclick='document.getElementById(&apos;light2&apos;).style.display=&apos;none&apos;'><img height='13' src='http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/32/Actions-window-close-icon.png' width='13'/></a></p>
&lt;a href=&quot;ใส่ลิงก์ URL ของแบนเนอร์&quot; target=&quot;_blank&quot;&gt;&lt;img width=&quot;160&quot; border=&quot;0&quot; height=&quot;600&quot; src=&quot;ใส่ URL รูปภาพแบนเนอร์&quot; style=&quot;padding-bottom: 0px; padding-right: 0px; border-bottom-width: 0px; margin-bottom: -6px;&quot;&gt;&lt;/a&gt;
</div>


3. โค้ดเลื่อนตาม Scrollbar ทางซ้ายและขวา
<style>   
.white_content1 {
position: fixed;
left: 29px;
z-index: 1030;
top: 5px;
padding: 2px;
background-color: white;
-webkit-box-shadow: 0 0 20px 4px #000000;
box-shadow: 0 0 0px 0px #000000;
}
.white_content2 {
position: fixed;
right: 29px;
z-index: 1030;
top: 5px;
padding: 2px;
background-color: white;
-webkit-box-shadow: 0 0 20px 4px #000000;
box-shadow: 0 0 0px 0px #000000;
}
</style>

<div class='white_content1' id='light1' style='display: block;'>
<p style='text-align: right;'>ปิดโฆษณานี้<a href='javascript:void(0)' onclick='document.getElementById(&apos;light1&apos;).style.display=&apos;none&apos;'><img height='13' src='http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/32/Actions-window-close-icon.png' width='13'/></a></p>
&lt;a href=&quot;ใส่ลิงก์ URL ของแบนเนอร์&quot; target=&quot;_blank&quot;&gt;&lt;img width=&quot;160&quot; border=&quot;0&quot; height=&quot;600&quot; src=&quot;ใส่ URL รูปภาพแบนเนอร์&quot; style=&quot;padding-bottom: 0px; padding-right: 0px; border-bottom-width: 0px; margin-bottom: -6px;&quot;&gt;&lt;/a&gt;
</div>

<div class='white_content2' id='light2' style='display: block;'>
<p style='text-align: right;'>ปิดโฆษณานี้<a href='javascript:void(0)' onclick='document.getElementById(&apos;light2&apos;).style.display=&apos;none&apos;'><img height='13' src='http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/32/Actions-window-close-icon.png' width='13'/></a></p>
&lt;a href=&quot;ใส่ลิงก์ URL ของแบนเนอร์&quot; target=&quot;_blank&quot;&gt;&lt;img width=&quot;160&quot; border=&quot;0&quot; height=&quot;600&quot; src=&quot;ใส่ URL รูปภาพแบนเนอร์&quot; style=&quot;padding-bottom: 0px; padding-right: 0px; border-bottom-width: 0px; margin-bottom: -6px;&quot;&gt;&lt;/a&gt;
</div>


*** ลองนำไปปรับใช้งานกันดูครับ ***


ไม่มีความคิดเห็น:

แสดงความคิดเห็น