Jquery 1.10.2 problem sa skriptom

Novi wordpress dolazi sa jquery verzijom 1.10.2 i koliko vidim mnogi imaju problema s ovim jer dosta skripti ovu brojku vidi kao 1.1 i smatra je zastarjelom verzijom.

Imam jedan counter koji takođjer ne radi na ovoj verziji, dok na 2.0 najnormalnije radi. Evo i code:

(function($) {
	$.fn.countdown = function(options, callback) {

		//custom 'this' selector
		thisEl = $(this);

		//array of custom settings
		var settings = { 
			'date': null,
			'format': null
		};

		//append the settings array to options
		if(options) {
			$.extend(settings, options);
		}
		
		//main countdown function
		function countdown_proc() {
			
			eventDate = Date.parse(settings['date']) / 1000;
			currentDate = Math.floor($.now() / 1000);
			
			if(eventDate <= currentDate) {
				callback.call(this);
				clearInterval(interval);
			}
			
			seconds = eventDate - currentDate;
			
			days = Math.floor(seconds / (60 * 60 * 24)); //calculate the number of days
			seconds -= days * 60 * 60 * 24; //update the seconds variable with no. of days removed
			
			hours = Math.floor(seconds / (60 * 60));
			seconds -= hours * 60 * 60; //update the seconds variable with no. of hours removed
			
			minutes = Math.floor(seconds / 60);
			seconds -= minutes * 60; //update the seconds variable with no. of minutes removed
			
			//conditional Ss
			if (days == 1) { thisEl.find(".timeRefDays").text("dan"); } else { thisEl.find(".timeRefDays").text("dan"); }
			if (hours == 1) { thisEl.find(".timeRefHours").text("sat"); } else { thisEl.find(".timeRefHours").text("sat"); }
			if (minutes == 1) { thisEl.find(".timeRefMinutes").text("min"); } else { thisEl.find(".timeRefMinutes").text("min"); }
			if (seconds == 1) { thisEl.find(".timeRefSeconds").text("sek"); } else { thisEl.find(".timeRefSeconds").text("sek"); }
			
			//logic for the two_digits ON setting
			if(settings['format'] == "on") {
				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;
			}
			
			//update the countdown's html values.
			if(!isNaN(eventDate)) {
				thisEl.find(".days").text(days);
				thisEl.find(".hours").text(hours);
				thisEl.find(".minutes").text(minutes);
				thisEl.find(".seconds").text(seconds);
			} else { 
				alert("Invalid date. Here's an example: 12 Tuesday 2012 17:30:00");
				clearInterval(interval); 
			}
		}
		
		//run the function
		countdown_proc();
		
		//loop the function
		interval = setInterval(countdown_proc, 1000);
		
	}
}) (jQuery);

A sam prikaz brojača se ovako poziva:

		<script>
			$(document).ready(function(){
				$("#countdown").countdown({
					date: "14 august 2013 23:55:00",
					format: "on"
				},
				
				function() {
					// callback function
				});
			});
		</script>

		<!-- TIMER -->
		<div class="timer-area">
			<ul id="countdown">
				<li>
					<span class="days">00</span>
					<p class="timeRefDays">DAN</p>
				</li>
				<li>
					<span class="hours">00</span>
					<p class="timeRefHours">SAT</p>
				</li>
				<li>
					<span class="minutes">00</span>
					<p class="timeRefMinutes">MIN</p>
				</li>
				<li>
					<span class="seconds">00</span>
					<p class="timeRefSeconds">SEK</p>
				</li>
			</ul>
		</div> <!-- end timer-area -->

Budući da nisam javascript expert, ako netko ima ideju zašto gornji code ne radi na verziji 1.10.2 ?

Evo tu je Apazinjan objasnio pa mozda je do toga

http://www.webmajstori.net/forum/42490-flex-slider-2-pomoc#post304326

Search and replace $ > jQuery

i stvar funkcionira :win:

Hvala na pomoći


Copyright © 2022 WM Forum - AboutContact