 |
|
 popup ก่อนเข้าชมเว็บไซต์ของหนูจะเด้งเป็นรูปภาพสไลด์ แต่อยากให้สามารถคลิกที่รูปแต่ละรูปก็ไปหน้าเว็บอื่นที่เราอยากให้ลิ้งค์ไป ขอผู้รู้ช่วยหน่อยนะทำอย่างไรให้สองรูปนี้ลิ้งไปเว็บอื่นๆได้คะ
<script>
$(document).ready(function(){
function openColorBox(){
$(".slide").colorbox({iframe:false, width:"750px", height:"550px",
transition:"fade",slideshowAuto: true,
rel:'slide',
slideshowSpeed:3500,
opacity: 0.9,
preloading: true,
slideshow:true
});
$("a.slide").first().click(); //สำคัญ
}
function countDown(){
seconds--
$("#seconds").text(seconds);
if (seconds === 0){
openColorBox();
clearInterval(i);
}
}
//กำหนดเวลา วินาทีที่จะให้ popup ทำงาน
var seconds = 2,
i = setInterval(countDown, 1000);
});
</script>
<body>
<a class="slide" src="images/8862.jpg" href = "https://www.google.com"></a>
<a class="slide" src="images/111.jpg" href = "https://www.sanook.com"></a>
------------------------------------------------------------------------------------------------------------------
Tag : PHP, JavaScript, jQuery
|
|
 |
 |
 |
 |
Date :
2020-08-26 23:23:29 |
By :
namasikan |
View :
628 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |