Specifies the time display picture link for code

In the time period specified picture link can click in between 13:00 to 15:00 can click on the rest of the time are empty connection
Ask the master pointing

Started by Winston at November 10, 2016 - 6:53 PM

Every second to obtain a local time or from the server. Once time every second to add a second if the time range to the corresponding a tag set href to the specified path is not within the set href is empty.

Posted by Uriah at November 17, 2016 - 7:14 PM

Thinking in the same #1 floor, probably was this meaning
<style>
#div1{height:200px;width:200px;background-color:yellow}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
var aa=setInterval(function(){
	var time=new Date();
	var hours=time.getHours();
	if(hours==14 || hours==15){
		document.getElementById('div1').attachEvent("onclick",method1); 
	}
},1000)

function method1(){
	alert(123);
}
</script>	
<div id="div1">
14-15 o'clock I dialog box will pop up
</div>

Posted by Rex at November 19, 2016 - 7:25 PM

<script type="text/javascript">
function picClick()//In response to the picture
{
  var hour=new Date().getHours();
  if (hour==13 || hour==14) window.open("http://www.baidu.com");//Open link in 13:00 to 15:00
}
</script>
<img src="The image path" onclick="picClick();" />

Posted by Joan at November 22, 2016 - 7:53 PM