Jineeshjohn’s Blog

Archive for the ‘Html’ Category

Here I would like to show a how to create a overlay for the parent window using jQuery.

 Parent window code 

// your jquery js path


/* A unique name for the window. 
    Used when ever dealing with multiple pop - up windows */
var wn = new Date().valueOf(); 
function disableParent(){
	var e = $("div.overlay");
	var p = $("body");
	e.height(p.height()).width(p.width()).show();
	
}
function enableParent(){
 	var e = $("div.overlay",opener.document).css("display","none");
	window.close();
}



	div.overlay{
		background-color:#666;
		position:absolute;
		display:none;
		z-index:10;
		height:800px;
		width:1000px;
		filter: alpha(opacity=50);
		opacity: 0.5;
	}



Hi,

Here i would like to show how to write a basic bubble sort using JavaScript.

 

function bubbleSort( arr ){
	var i = arr.length - 1, j;
	for (i ; i >= 0; i--){
		for (j = 0; j <= i; j++){
			if (arr[j+1] < arr[j]) {
				var temp = arr[j];
				arr[j] = arr[j+1];
				arr[j+1] = temp;
			}
		}
	}
	return arr;
}

 

Setting Iframe 100 percent Width and Height

When ever a Iframe has to be made 100 percent height. Its parent page body tag and html tag has to me made 100 percent.


html, body {
	margin:0;
	height:100%;
	width:100%;
} 



  • None
  • No comments yet

Categories