我需要<lastmod></lastmod>在sitemap.xml中的标签中显示的日期格式。我怎样才能做到这一点?
输出如:
<lastmod>2016-01-21EEST18:01:18+03:00</lastmod>
Run Code Online (Sandbox Code Playgroud)
其中“EEST”可能是时区偏移量。
我在 php 中看到过这个问题和答案:
但不知道如何在 Javascript 中实现它,
谢谢。
编辑:这个问题不是重复的,因为我需要在 JavaScript 中使用正确的时间格式。
我正在尝试制作一个能够为倒计时制作动画的小插件.
但是,出于某种原因,它无法正常工作.这是代码:
$(window).onload(function() {
$('.three').fadeIn('fast');
$('.three').fadeOut('slow');
$('.two').fadeIn('fast');
$('.two').fadeOut('slow');
$('.one').fadeIn('fast');
$('.one').fadeOut('slow');
$('.oneone').fadeIn('fast');
$('.oneone').fadeOut('slot');
$('.vote').fadeIn('slow');
$('.vote').fadeOut('slow');
$('html').effect('shake');
});Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<div>
<div class="three">3</div>
<div class="two">2</div>
<div class="one">1</div>
<div class="oneone">0.5</div>
<div class="vote">VOTE!</div>
</div>Run Code Online (Sandbox Code Playgroud)
我希望这个倒计时出现在窗口加载和css我会风格.但首先我要倒计时:3 2 1 0.5投票!
主类将具有最高的z指数.
我正在尝试建立一个投票系统来检查用户何时投票,然后将html项目css从"投票"改为"谢谢",背景颜色改为"绿色".
现在这很好用,但是当用户刷新页面以检查cookie是否存在(cookie已经设置=变量是voteCookie('id'))然后应用class ="exists"时,我需要做出选项.如果它不存在则隐藏该类.那堂课会说"谢谢投票",没有别的.
jQuery的:
$(window).ready(function() {
var voteId = $('.gallery-item a');
$(voteId).on('click', function() {
$(this).text('Thank you!');
$(this).css('background-color', 'green');
});
});
Run Code Online (Sandbox Code Playgroud)