Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/447.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在jquery函数中调用动态URL?_Javascript_Jquery_Html_Javascript Events_Jquery Countdown - Fatal编程技术网

Javascript 如何在jquery函数中调用动态URL?

Javascript 如何在jquery函数中调用动态URL?,javascript,jquery,html,javascript-events,jquery-countdown,Javascript,Jquery,Html,Javascript Events,Jquery Countdown,我如何在事件结束后使用下面的每个计时器调用URL?我通过了所有的倒计时密码。我需要找到我的地方,我的网址,这将是超链接图像后计时器显示,时间结束后的图片显示,但与未定义的URL链接。其中我声明此变量=+match_link+以在事件后显示链接: var match_link = digits[elem].parent().parent().parent().children('.match-info').children('a:first-child').attr('href');

我如何在事件结束后使用下面的每个计时器调用URL?我通过了所有的倒计时密码。我需要找到我的地方,我的网址,这将是超链接图像后计时器显示,时间结束后的图片显示,但与未定义的URL链接。其中我声明此
变量=+match_link+
以在事件后显示链接:

var match_link = digits[elem].parent().parent().parent().children('.match-info').children('a:first-child').attr('href');
          digits[elem].parent().parent().html('<a href="'+match_link+'" class="live-now"><img width="145" height="35" src="http://files.barcelonastream.com/media-resources/other/WatchNow.png" class="attachment-medium" alt="WatchNow" title="WatchNow"></a>');
var match_link=digits[elem].parent().parent().parent().children('.match info').children('a:first child').attr('href');
数字[elem].parent().parent().html(“”);

//
jQuery.fn.countdown=函数(userOptions)
{
//默认选项
变量选项={
步骤时间:60,
//开始时间和格式必须遵循相同的格式。
//此外,您不能指定无序的格式(例如hh:ss:mm错误)
格式:“dd:hh:mm:ss”,
事件时间:“2014年1月1日00:00”,
数字图像:6,
数字宽度:53,
数字八:77,
timerEnd:function(){},
图片:“digits.png”
};
变量位数=[],区间;
userOptions.startTime=timeleft(userOptions.eventTime);
//在给定容器中绘制数字
var createDigits=函数(其中)
{
var c=0;
var tempStartTime=options.startTime;
//迭代每个起始时间数字(如果不是数字)
//我们会确定它是一个分离器
对于(var i=0;i=0)
{
elem=jQuery(“”).css({
高度:options.digithweight*options.digitmages*10,
float:'left',background:'url(\''+options.image+'\'),
宽度:options.digitWidth});
数字推送(elem);
边距(c,-((parseInt(tempStartTime.charAt(i))*options.digithweight*
选项(数字图像);
数字[c]。uu max=9;
//添加最大位数,例如,分钟的第一位数(mm)为
//最大值为5。当左位数达到时,使用条件最大值
//例如,第二个“小时”数字的最大值为3
开关(选项.格式.字符(i)){
案例“h”:
数字[c]。uu max=(c%2==0)?2:9;
如果(c%2!=0)
数字[c]。uu condmax=3;
打破
案例“d”:
数字[c]。uu max=9;
打破
案例“m”:
案例s:
数字[c]。uu max=(c%2==0)?5:9;
}
++c;
}
其他的
elem=jQuery(“”).css({float:'left'})
.text(tempStartTime.charAt(i));
其中。附加(“”);
其中。追加(elem);
其中。附加(“”);
}
};
//设置或获取元素边距
var保证金=功能(要素,val)
{
如果(val!==未定义)
返回数字[elem].css({'marginTop':val+'px'});
返回parseInt(数字[elem].css('marginTop')。替换('px','');
};
//进行移动。这是通过“数字图像”步骤完成的。
var moveStep=功能(元素)
{
数字[elem]。_digitiinitial=-(数字[elem]。_max*options.digithweight*options.digitImages);
返回函数_move(){
mtop=边距(元素)+options.digithweight;
if(mtop==options.digithweight){
边距(元素,数字[元素]。_digitInitial);
如果(elem>0)移动步骤(elem-1)();
其他的
{
间隔时间;
对于(var i=0;i0)和&(数字[元素]。\uu condmax!==未定义)&&
(数字[elem-1]。_digitiinitial==边距(elem-1)))
边距(elem,-(数字[elem].\uu condmax*options.digithweight*options.digitImages));
回来
}
保证金(要素、mtop);
if(边距(元素)/options.digithweight%options.digitImages!=0)
setTimeout(_move,options.stepTime);
如果(mtop==0)位[elem]。\uu ismax=true;
}
};
extend(options,userOptions);
css({height:options.digithweight,overflow:'hidden'});
创建数字(本);
间隔=设置间隔(移动步长(位数.length-1),1000);
};
函数timeleft(eventTime){
var now=新日期();
var now_utc=新日期(now.getUTCFullYear()、now.getUTCMonth()、now.getUTCDate()、now.getUTCHours()、now.getUTCMinutes()、now.getUTCSeconds());
var event_time=新日期(eventTime);
var t1=now_utc.getTime();
//从日期中删除一小时-60分钟*60秒*1000毫秒--60*60*1000
var t2=event_time.getTime();
var time_left=新日期(parseInt(t2-t1));

如果(time_left如果我理解正确,您可以使用.html函数

$('sct#u id_0').html(“”)

实际上,它只适用于一个事件,但我在多个事件中使用它,因此可以在一个事件中使用,但不能在多个事件中使用
$('#sct_id_0').html("<img src='http://findicons.com/icon/download/169459/alert/128/png' /> ")