Skip to content

A proof of concept for of a jQuery plugin that loads views (via AJAX) based on the current window's width of the client.

Notifications You must be signed in to change notification settings

Eyal-Archive/ViewsLoader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ViewsLoader

A proof of concept for of a jQuery plugin that loads views (via AJAX) based on the current window's width of the client.

Usage:

<script type="text/javascript">
/* <![CDATA[ */
	(function($)
	{
		// The table that defines the views.
		var viewTable = [
			{ minWidth: "0", url: "_small.html" },
			{ minWidth: "400", url: "_medium.html" },
			{ minWidth: "800", url: "_normal.html" }
		];

		// The function that on reize manipulates the views.
		$("#content").loadView(viewTable);

		// Fires resize (on document load) to load the view for the current window's width.
		$(function() {
			$(window).resize();
		});

	})(jQuery);
/* ]]> */
</script>

About

A proof of concept for of a jQuery plugin that loads views (via AJAX) based on the current window's width of the client.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published