Z uwagi na dużą liczbę wpisów stworzonych bez wątpienia wyłącznie w celu pozycjonowania stron na określone frazy, dodaliśmy do wszystkich linków (w postach i podpisach) atrybut rel="nofollow". Z tego względu wszystkie dodane linki straciły swoją moc pozycjonerską. Forum jest dla Was, dlatego prosimy o zamieszczanie wyłącznie "prawdziwych" tematów i odpowiedzi.

Jak uruchomić zegar?

Forum dla osób rozpoczynających przygodę z webdesignem
  • Wiadomości
Offline
Awatar użytkownika

peggibe

  • Posty: 61
  • Rejestracja: 19 sty 2013, o 20:26

Jak uruchomić zegar?

Post11 paź 2018, o 15:57

Hej, mam kupiony szablon strony www, ale nie umiem ustawić odliczania countDown. Poniżej przesyłam kod z głównego pliku html oraz wydaje mi się dwa odpowiadające skrypty js


<!DOCTYPE html>
<html>
<head>
<title>Rhythm &mdash; One & Multi Page Creative Theme</title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta charset="utf-8">
<meta name="author" content="Roman Kirichik">
<!--[if IE]><meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'><![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

<!-- Favicons -->
<link rel="shortcut icon" href="images/favicon.png">
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">

<!-- CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/style-responsive.css">
<link rel="stylesheet" href="css/animate.min.css">
<link rel="stylesheet" href="css/vertical-rhythm.min.css">
<link rel="stylesheet" href="css/owl.carousel.css">
<link rel="stylesheet" href="css/magnific-popup.css">


</head>
<body class="appear-animate">

<!-- Page Loader -->
<div class="page-loader">
<div class="loader">Loading...</div>
</div>
<!-- End Page Loader -->

<!-- Page Wrap -->
<div class="page" id="top">

<!-- Home Section -->
<section class="home-section bg-light parallax-2" data-background="images/full-width-images/section-bg-5.jpg" id="home">
<div class="js-height-full">

<!-- Hero Content -->
<div class="home-content">
<div class="home-text">

<div class="container align-center">
<div class="row">
<div class="col-sm-8 col-sm-offset-2">

<!-- Timer -->
<ul class="countdown dark clearlist clearfix mb-80 mb-xs-20" data-finish-date="01/07/2017 12:00:00" data-UTC="2" data-finish-message="We have already started!">
<li>
<span class="countdown-number"><span class="days font-alt">00</span><b class="days_ref">days</b></span>
</li>
<li>
<span class="countdown-number"><span class="hours font-alt">00</span><b class="hours_ref">hours</b></span>
</li>
<li>
<span class="countdown-number"><span class="minutes font-alt">00</span><b class="minutes_ref">minutes</b></span>
</li>
<li>
<span class="countdown-number"><span class="seconds font-alt">00</span><b class="seconds_ref">seconds</b></span>
</li>
</ul>
<!-- End Timer -->

<p class="lead text-mobile mt-0 mb-40 mb-xs-20">We are currently working on launching a website. Soon we will be online. Sign up for our newsletter and we will inform you about the launch of our website.</p>

<div class="local-scroll">
<a href="#subscribe" class="btn btn-mod btn-medium btn-round">Subscribe now</a>
</div>

</div>
</div>

</div>

</div>
</div>
<!-- End Hero Content -->

<!-- Scroll Down -->
<div class="local-scroll">
<a href="#about" class="scroll-down"><i class="fa fa-angle-down scroll-down-icon"></i></a>
</div>
<!-- End Scroll Down -->

</div>
</section>
<!-- End Home Section -->

</div>
<!-- End Page Wrap -->

<!-- JS -->
<script type="text/javascript" src="js/jquery-1.11.2.min.js"></script>
<script type="text/javascript" src="js/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/SmoothScroll.js"></script>
<script type="text/javascript" src="js/jquery.scrollTo.min.js"></script>
<script type="text/javascript" src="js/jquery.localScroll.min.js"></script>
<script type="text/javascript" src="js/jquery.viewport.mini.js"></script>
<script type="text/javascript" src="js/jquery.countTo.js"></script>
<script type="text/javascript" src="js/jquery.appear.js"></script>
<script type="text/javascript" src="js/jquery.sticky.js"></script>
<script type="text/javascript" src="js/jquery.parallax-1.1.3.js"></script>
<script type="text/javascript" src="js/jquery.fitvids.js"></script>
<script type="text/javascript" src="js/owl.carousel.min.js"></script>
<script type="text/javascript" src="js/isotope.pkgd.min.js"></script>
<script type="text/javascript" src="js/imagesloaded.pkgd.min.js"></script>
<script type="text/javascript" src="js/jquery.magnific-popup.min.js"></script>
<!-- Replace test API Key "AIzaSyAZsDkJFLS0b59q7cmW0EprwfcfUA8d9dg" with your own one below
**** You can get API Key here - https://developers.google.com/maps/docu ... et-api-key -->
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAZsDkJFLS0b59q7cmW0EprwfcfUA8d9dg"></script>
<script type="text/javascript" src="js/gmap3.min.js"></script>
<script type="text/javascript" src="js/wow.min.js"></script>
<script type="text/javascript" src="js/masonry.pkgd.min.js"></script>
<script type="text/javascript" src="js/jquery.simple-text-rotator.min.js"></script>
<script type="text/javascript" src="js/all.js"></script>
<script type="text/javascript" src="js/contact-form.js"></script>
<script type="text/javascript" src="js/jquery.ajaxchimp.min.js"></script>
<script type="text/javascript" src="js/jquery.downCount.js"></script>
<!--[if lt IE 10]><script type="text/javascript" src="js/placeholder.js"></script><![endif]-->

</body>
</html>


...a moją idolką jest Peggy
Offline
Awatar użytkownika

peggibe

  • Posty: 61
  • Rejestracja: 19 sty 2013, o 20:26

Re: Jak uruchomić zegar?

Post11 paź 2018, o 15:57

(function(e){function t(e,t){return e.toFixed(t.decimals)}e.fn.countTo=function(t){t=t||{};return e(this).each(function(){function l(){a+=i;u++;c(a);if(typeof n.onUpdate=="function"){n.onUpdate.call(s,a)}if(u>=r){o.removeData("countTo");clearInterval(f.interval);a=n.to;if(typeof n.onComplete=="function"){n.onComplete.call(s,a)}}}function c(e){var t=n.formatter.call(s,e,n);o.text(t)}var n=e.extend({},e.fn.countTo.defaults,{from:e(this).data("from"),to:e(this).data("to"),speed:e(this).data("speed"),refreshInterval:e(this).data("refresh-interval"),decimals:e(this).data("decimals")},t);var r=Math.ceil(n.speed/n.refreshInterval),i=(n.to-n.from)/r;var s=this,o=e(this),u=0,a=n.from,f=o.data("countTo")||{};o.data("countTo",f);if(f.interval){clearInterval(f.interval)}f.interval=setInterval(l,n.refreshInterval);c(a)})};e.fn.countTo.defaults={from:0,to:0,speed:1e3,refreshInterval:100,decimals:0,formatter:t,onUpdate:null,onComplete:null}})(jQuery)
...a moją idolką jest Peggy
Offline
Awatar użytkownika

peggibe

  • Posty: 61
  • Rejestracja: 19 sty 2013, o 20:26

Re: Jak uruchomić zegar?

Post11 paź 2018, o 15:58

// Countdown Init Init
$(document).ready(function(){

var countdown = $(".countdown");
var data_finish_date = countdown.attr("data-finish-date");
var data_UTC = countdown.attr("data-UTC");
var data_finish_message = countdown.attr("data-finish-message");

countdown.downCount({
date: data_finish_date,
offset: data_UTC
}, function(){
alert(data_finish_message);
});

});


/**
* downCount: Simple Countdown clock with offset
* Author: Sonny T. <hi@sonnyt.com>, sonnyt.com
*/

(function ($) {

$.fn.downCount = function (options, callback) {
var settings = $.extend({
date: null,
offset: null
}, options);

// Throw error if date is not set
if (!settings.date) {
$.error('Date is not defined.');
}

// Throw error if date is set incorectly
if (!Date.parse(settings.date)) {
$.error('Incorrect date format, it should look like this, 12/24/2012 12:00:00.');
}

// Save container
var container = this;

/**
* Change client's local date to match offset timezone
* @return {Object} Fixed Date object.
*/
var currentDate = function () {
// get client's current date
var date = new Date();

// turn date to utc
var utc = date.getTime() + (date.getTimezoneOffset() * 60000);

// set new Date object
var new_date = new Date(utc + (3600000*settings.offset))

return new_date;
};

/**
* Main downCount function that calculates everything
*/
function countdown () {
var target_date = new Date(settings.date), // set target date
current_date = currentDate(); // get fixed current date

// difference of dates
var difference = target_date - current_date;

// if difference is negative than it's pass the target date
if (difference < 0) {
// stop timer
clearInterval(interval);

if (callback && typeof callback === 'function') callback();

return;
}

// basic math variables
var _second = 1000,
_minute = _second * 60,
_hour = _minute * 60,
_day = _hour * 24;

// calculate dates
var days = Math.floor(difference / _day),
hours = Math.floor((difference % _day) / _hour),
minutes = Math.floor((difference % _hour) / _minute),
seconds = Math.floor((difference % _minute) / _second);

// fix dates so that it will show two digets
days = (String(days).length >= 2) ? days : '0' + days;
hours = (String(hours).length >= 2) ? hours : '0' + hours;
minutes = (String(minutes).length >= 2) ? minutes : '0' + minutes;
seconds = (String(seconds).length >= 2) ? seconds : '0' + seconds;

// based on the date change the refrence wording
var ref_days = (days === 1) ? 'day' : 'days',
ref_hours = (hours === 1) ? 'hour' : 'hours',
ref_minutes = (minutes === 1) ? 'minute' : 'minutes',
ref_seconds = (seconds === 1) ? 'second' : 'seconds';

// set to DOM
container.find('.days').text(days);
container.find('.hours').text(hours);
container.find('.minutes').text(minutes);
container.find('.seconds').text(seconds);

container.find('.days_ref').text(ref_days);
container.find('.hours_ref').text(ref_hours);
container.find('.minutes_ref').text(ref_minutes);
container.find('.seconds_ref').text(ref_seconds);
};

// start
var interval = setInterval(countdown, 300);
};

})(jQuery);
...a moją idolką jest Peggy
Offline
Awatar użytkownika

peggibe

  • Posty: 61
  • Rejestracja: 19 sty 2013, o 20:26

Re: Jak uruchomić zegar?

Post11 paź 2018, o 15:58

Z góry dzięki za pomoc
...a moją idolką jest Peggy
Offline
Awatar użytkownika

peggibe

  • Posty: 61
  • Rejestracja: 19 sty 2013, o 20:26

Re: Jak uruchomić zegar?

Post13 paź 2018, o 09:26

w razie czego mogę przesłać na maila pliki strony jakby te nie wystarczyły.
...a moją idolką jest Peggy

Wróć do Początkujący Webmaster

Kto jest online

Użytkownicy przeglądający to forum: Obecnie na forum nie ma żadnego zarejestrowanego użytkownika i 0 gości

cron