View Single Post
Old 08-04-2009, 10:13 PM   PM User | #1
lauthiamkok
Regular Coder

 
Join Date: Dec 2008
Posts: 117
Thanks: 14
Thanked 0 Times in 0 Posts
lauthiamkok is an unknown quantity at this point
jquery: get the window size when minimise it.

hi,
this is the code i get the window size (width) when the page is ready.

Code:
$(document).ready(function(){

	var height_window = $(window).height(); 
	var width_window = $(window).width();

	var margin_left = (width_window/2) - (840/2);
	$('.slide').css({width:width_window+'px'});
	$('.content').css({marginLeft:margin_left+'px'});
	
	$('#enter').click(function () {
		$('#container').animate({marginLeft:'-'+width_window+'px'}, 600);
	return false;
	});	
	
	$('#back').click(function () {
		$('#container').animate({marginLeft:'0px'}, 600);
	return false;
	});
});

ideally, i hope to get the window size as well when you make the window smaller by dragging it... what event should i be using then??

this is the implimentation of the entire code,
http://partexchangeco.org.uk/home.php

many thanks,
Lau
lauthiamkok is offline   Reply With Quote