Javescript/Jquery Error: f.easing[e.animatedProperties[this.prop]] is not a function

Error: f.easing[e.animatedProperties[this.prop]] is not a function

Error: f.easing[e.animatedProperties[this.prop]] is not a function

This problem happens with jQuery Easing Plugin. This error occurs when a newer version of jquery and jquery.easing is used with an older version of the call to animate.easing.

Solution:
Use the following jQuery, JQuery Easing and JQuery Easing Compatibility
Download JQuery – Latest version from JQuery

Download JQuery – Version 1.5.2 hosted at Google

JQuery Easing Plugin – Version 1.3 by George McGinley Smith

JQuery Easing Compatibility (for use with older versions) – by George McGinley Smith

jQuery: How to add ‘onchange’ attribute in a ‘select’ tag?

<select id="sel_id">
</select>

Works for me if I use the native setAttribute().

Also, remember that you need quotes around the selector.

$("#sel_id")[0].setAttribute("onchange", "foo()");

the final html will be

<select id="sel_id" onchange="foo();" >
</select>

Also remember to define foo in the global namespace, and not inside jQuery’s .ready() function.

Source:
http://stackoverflow.com/a/3638016

jQuery: Append a CSS class to any item or last item

<script type="text/javascript">
	jQuery("p:last").addClass(" last");
</script>

It’s important to note that this method does not replace a class. It simply adds the class, appending it to any which may already be assigned to the elements.

More than one class may be added at a time, separated by a space, to the set of matched elements, like so:

$("p").addClass("myClass yourClass");

(more…)

jQuery: Even and odd classes for series of divs

<html>
	<head>
		<style>
			.odd {
				height: 5px;
				background: #960;
			}
			.even {
				height: 5px;
				background: #09C;
			}
		</style>
		<script src="js/jquery-1.7.1.min.js"></script>
		<script type="text/javascript">
			$(document).ready(function() {
				$('div:odd').addClass('odd');
				$('div:even').addClass('even');
			})
		</script>
	</head>
	<body>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
		<div></div>
	</body>
<html>

Setting Equal Heights with jQuery

We wrote a script to “equalize” the heights of boxes within the same container and create a tidy grid — with little overhead.

Creating the visual effect of equal-height columns or content boxes has been a challenge ever since we abandoned table-based layouts. When developing complex web applications or site designs we’ve found that it often makes the most sense from a usability and performance standpoint to use a simple JavaScript workaround: our equalHeights() function determines the heights of all sibling elements in a container, and then sets each element’s minimum height to that of the tallest element. When JavaScript is disabled, the boxes or columns appear with varying heights, but the content remains legible and the page is still completely usable.
(more…)

Pin It on Pinterest