Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

$ is not defined error 1

Status
Not open for further replies.

tyutghf

Technical User
Apr 12, 2008
258
GB
I am getting the error '$ is not defined error' in the following javascript. The line in question is the

$(document).ready(function() {

line, can someone see a problem?

Thanks

Code:
		var currentPosition;
		var currentVolume;
		var currentState;
	
		function sendEvent(typ,prm) { thisMovie("jstest").sendEvent(typ,prm);};
		
		function getUpdate(typ,pr1,pr2,pid) {
		if(typ == "time") { currentPosition = pr1; document.getElementById("progress").style.width = currentPosition/((pr2+pr1)/70.1)+"%" ;document.getElementById("timer").value =formatTime(currentPosition);if(currentPosition/((pr2+pr1)/70.1)==70.1) {document.getElementById("playStop").className = "playStop" }}
		else if(typ == "state") { currentState = pr1; if(currentState==3) { playtoggle();};if(currentState==0) { document.getElementById("playStop").className = "playStop" };if(currentState==2) { document.getElementById("playStop").className = "playStop pause" };if(currentState==1) { document.getElementById("playStop").className = "playStop pause" };}
		else if(typ == "volume") { currentVolume = pr1; }
		};

		function thisMovie(movieName) {
		if(navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName];
		} else {
		return document[movieName];
		}
		};
		
		function formatTime(time){
			var sec = time % 60;
			if (sec < 10)
				sec = "0" + sec;
			var min = Math.floor(time / 60);
			if (min < 10)
				min = "0" + min;
			return min+":"+sec;
		};
		
		$(document).ready(function()	{
			jQuery.fn.slideFadeHeight=function(speed, easing, callback) {
				return this.animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback);
			};
				
			$('.titleVolume .volume img').click(function(){
				$(".volumeBar .clicked").addClass('hideclick');
			}).toggle(function(){$('.titleVolume').addClass('mute')},function(){
				$('.titleVolume').removeClass('mute');
				$('.volumeBar .clicked').removeClass('hideclick');
			});
			
			$('.about').hide();
			
			$('.bgWhat').click(function() {
				$('.about').slideFadeHeight('slow');
			});
			
			$('.bgPlay img').mouseover(function(){
				$(this).parent().addClass('over');
			}).mouseout(function(){
				$(this).parent().removeClass('over');
			});
			
			$('.volume img').mouseover(function(){
				$(this).parent().addClass('over');
			}).mouseout(function(){
				$(this).parent().removeClass('over');
			});
			
			$('.bgWhat img').mouseover(function(){
				$(this).parent().addClass('over');
			}).mouseout(function(){
				$(this).parent().removeClass('over');
			});
			
			$(".volumeBar li[class!='clicked']").click(function(){
				$(".volumeBar li").removeClass('clicked').removeClass('hideclick');
				$(this).addClass('clicked');
				$('.titleVolume').removeClass('mute');
			});
			
			$(".volumeBar li").click(function(){
				$('.titleVolume').removeClass('mute');
			});
		});
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top