Click here to Skip to main content
15,923,168 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: How to find all open browsers ? Pin
InderK12-Aug-10 5:38
InderK12-Aug-10 5:38 
GeneralRe: How to find all open browsers ? Pin
T M Gray12-Aug-10 10:01
T M Gray12-Aug-10 10:01 
AnswerRepost Pin
Not Active9-Aug-10 2:15
mentorNot Active9-Aug-10 2:15 
GeneralRe: Repost Pin
InderK9-Aug-10 2:22
InderK9-Aug-10 2:22 
GeneralRe: Repost Pin
Not Active9-Aug-10 3:13
mentorNot Active9-Aug-10 3:13 
QuestionCheck FIle Exist in Javascript Pin
ShafiqA8-Aug-10 20:10
ShafiqA8-Aug-10 20:10 
AnswerRe: Check FIle Exist in Javascript PinPopular
NeverHeardOfMe8-Aug-10 22:11
NeverHeardOfMe8-Aug-10 22:11 
QuestionCSS not getting implemented on the jQuery dialog within IE8 Pin
Vipul Mehta8-Aug-10 18:16
Vipul Mehta8-Aug-10 18:16 
Hi,

I am new to jQuery. We are using jQuery ui.1.0 in our project. We are using jQuery to show the dialog box. It has CSS implmented for the dialog title and the content. The CSS works well within the dialog box when seen in IE6 but the CSS does not get implemented when the same dialog box is opened/diaplayed in IE8.

Within the IIS I have added below header for the page where the dialogbox is been implemented.

Header name => X-UA-Compatible
Header value => ID=6

What other changes do I need to make in order to make this work in IE8 as well?

Below is the .css code
/* This file skins dialog */

.flora .ui-dialog,
.flora.ui-dialog {
	background-color: #e6f7d4;
}

.flora .ui-dialog .ui-dialog-titlebar,
.flora.ui-dialog .ui-dialog-titlebar {
	border-bottom: 1px solid #d8d2aa;
	background: #ff9900 url(i/dialog-title.gif) repeat-x;
	padding: 0px;
	cursor: move;
	height: 28px;
	_height: 29px;
}

.flora .ui-dialog .ui-dialog-titlebar-close,
.flora.ui-dialog .ui-dialog-titlebar-close {
	width: 16px;
	height: 16px;
	background: url(i/dialog-titlebar-close.png) no-repeat;
	position:absolute;
	top: 6px;
	right: 7px;
	cursor: default;
}

.flora .ui-dialog .ui-dialog-titlebar-close-hover,
.flora.ui-dialog .ui-dialog-titlebar-close-hover {
	background: url(i/dialog-titlebar-close-hover.png) no-repeat;
}

.flora .ui-dialog .ui-dialog-title,
.flora.ui-dialog .ui-dialog-title {
	margin-left: 5px;
	color: white;
	font-weight: bold;
	position: relative;
	top: 7px;
	left: 4px;
}

.flora .ui-dialog .ui-dialog-content,
.flora.ui-dialog .ui-dialog-content {
	margin: 1.2em;
}

.flora .ui-dialog .ui-dialog-buttonpane,
.flora.ui-dialog .ui-dialog-buttonpane {
	position: absolute;
	bottom: 8px;
	right: 12px;
	width: 100%;
	text-align: right;
}

.flora .ui-dialog .ui-dialog-buttonpane button,
.flora.ui-dialog .ui-dialog-buttonpane button {
	margin: 6px;
}

/* Dialog handle styles */
.flora .ui-dialog .ui-resizable-n,
.flora.ui-dialog .ui-resizable-n { cursor: n-resize; height: 6px; width: 100%; top: 0px; left: 0px; background: transparent url(i/dialog-n.gif) repeat scroll center top; }

.flora .ui-dialog .ui-resizable-s,
.flora.ui-dialog .ui-resizable-s { cursor: s-resize; height: 8px; width: 100%; bottom: 0px; left: 0px; background: transparent url(i/dialog-s.gif) repeat scroll center top; }

.flora .ui-dialog .ui-resizable-e,
.flora.ui-dialog .ui-resizable-e { cursor: e-resize; width: 7px; right: 0px; top: 0px; height: 100%; background: transparent url(i/dialog-e.gif) repeat scroll right center; }

.flora .ui-dialog .ui-resizable-w,
.flora.ui-dialog .ui-resizable-w { cursor: w-resize; width: 7px; left: 0px; top: 0px; height: 100%; background: transparent url(i/dialog-w.gif) repeat scroll right center; }

.flora .ui-dialog .ui-resizable-se,
.flora.ui-dialog .ui-resizable-se { cursor: se-resize; width: 9px; height: 9px; right: 0px; bottom: 0px; background: transparent url(i/dialog-se.gif); }

.flora .ui-dialog .ui-resizable-sw,
.flora.ui-dialog .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: 0px; bottom: 0px; background: transparent url(i/dialog-sw.gif); }

.flora .ui-dialog .ui-resizable-nw,
.flora.ui-dialog .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 29px; left: 0px; top: 0px; background: transparent url(i/dialog-nw.gif); }

.flora .ui-dialog .ui-resizable-ne,
.flora.ui-dialog .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 29px; right: 0px; top: 0px; background: transparent url(i/dialog-ne.gif); }


Below is the jQuery code

(function($)
{
	//If the UI scope is not availalable, add it
	$.ui = $.ui || {};

	$.fn.dialog = function(o) {
		return this.each(function() {
			if (!$(this).is(".ui-dialog")) new $.ui.dialog(this, o);
		});
	}
	$.fn.dialogOpen = function() {
		return this.each(function() {
			var contentEl;
			if ($(this).parents(".ui-dialog").length) contentEl = this;
			if (!contentEl && $(this).is(".ui-dialog")) contentEl = $('.ui-dialog-content', this)[0];
			$.ui.dialogOpen(contentEl)
		});
	}
	$.fn.dialogClose = function() {
		return this.each(function() {
			var contentEl;
			if ($(this).parents(".ui-dialog").length) contentEl = this;
			if (!contentEl && $(this).is(".ui-dialog")) contentEl = $('.ui-dialog-content', this)[0];
			$.ui.dialogClose(contentEl);
		});
	}

	$.ui.dialog = function(el, o) {
		
		var options = {
			width: 300,
			height: 200,
			position: 'center',
			buttons: [],
			modal: false,
			drag: true,
			resize: true,
			shadow: false // It's quite slow
		};
		var o = o || {}; $.extend(options, o); //Extend and copy options
		this.element = el; var self = this; //Do bindings
		$.data(this.element, "ui-dialog", this);

		var uiDialogContent = $(el).addClass('ui-dialog-content')
			.wrap(document.createElement('div'))
			.wrap(document.createElement('div'));
		var uiDialogContainer = uiDialogContent.parent().addClass('ui-dialog-container').css({position: 'relative'});
		var uiDialog = uiDialogContainer.parent()
			.addClass('ui-dialog').addClass(uiDialogContent.attr('className'))
			.css({position: 'absolute', width: options.width, height: options.height});
    
        if (options.modal == false && options.resize == true) {
		    uiDialog.append("<div class='ui-resizable-n ui-resizable-handle'></div>")
                .append("<div class='ui-resizable-s ui-resizable-handle'></div>")
                .append("<div class='ui-resizable-e ui-resizable-handle'></div>")
                .append("<div class='ui-resizable-w ui-resizable-handle'></div>")
                .append("<div class='ui-resizable-ne ui-resizable-handle'></div>")
                .append("<div class='ui-resizable-se ui-resizable-handle'></div>")
                .append("<div class='ui-resizable-sw ui-resizable-handle'></div>")
                .append("<div class='ui-resizable-nw ui-resizable-handle'></div>");
      
		    uiDialog.resizable();
		}

		uiDialogContainer.prepend('<div class="ui-dialog-titlebar"></div>');
		var uiDialogTitlebar = $('.ui-dialog-titlebar', uiDialogContainer);
		var title = (options.title) ? options.title : (uiDialogContent.attr('title')) ? uiDialogContent.attr('title') : '';
		uiDialogTitlebar.append('<span class="ui-dialog-title">' + title + '</span>');
		uiDialogTitlebar.append('<div class="ui-dialog-titlebar-close"></div>');
		$('.ui-dialog-titlebar-close', uiDialogTitlebar)
			.hover(function() { $(this).addClass('ui-dialog-titlebar-close-hover'); }, 
			       function() { $(this).removeClass('ui-dialog-titlebar-close-hover'); })
			.mousedown(function(ev) {
				ev.stopPropagation();
			})
			.click(function() {
				self.close();
			});
		var l = 0;
		$.each(options.buttons, function() { l = 1; return false; });
        if (l == 1) {
		    uiDialog.append('<div class="ui-dialog-buttonpane"></div>');
		    var uiDialogButtonPane = $('.ui-dialog-buttonpane', uiDialog);
		    $.each(options.buttons, function(name, value) {
		    	var btn = $(document.createElement('button')).text(name).click(value);
		    	uiDialogButtonPane.append(btn);
		    });
		}
        
        if (options.modal == false && options.drag == true) {
		    uiDialog.draggable({ handle: '.ui-dialog-titlebar' });
        }
        
		this.open = function() {
			var wnd = $(window), top = 0, left = 0;
			switch (options.position) {
				case 'center':
					top = (wnd.height() / 2) - (uiDialog.height() / 2);
					left = (wnd.width() / 2) - (uiDialog.width() / 2);
					break;
				case 'left':
				    top = (wnd.height() / 2) - (uiDialog.height() / 2);
				    left = 0;
				    break;
				case 'top':
    			    top = 0;
					left = (wnd.width() / 2) - (uiDialog.width() / 2);
					break;
			}
			uiDialog.css({top: top, left: left});
			uiDialog.appendTo('body').show();
		};

		this.close = function() {
			uiDialog.hide();
		};

		uiDialog.show();
		this.open();
        if (options.shadow && $.fn.shadow != undefined) {
            uiDialog.shadow();
        }
	}

	$.ui.dialogOpen = function(el) {
		$.data(el, "ui-dialog").open();
	}

	$.ui.dialogClose = function(el) {
		$.data(el, "ui-dialog").close();
	}

})(jQuery);

Regards,
Vipul Mehta

Questionget input text value on text change Pin
Shantanu Gupta 13378-Aug-10 4:02
Shantanu Gupta 13378-Aug-10 4:02 
AnswerRe: get input text value on text change Pin
Sandeep Mewara8-Aug-10 4:47
mveSandeep Mewara8-Aug-10 4:47 
GeneralRe: get input text value on text change Pin
Shantanu Gupta 13378-Aug-10 6:11
Shantanu Gupta 13378-Aug-10 6:11 
GeneralRe: get input text value on text change Pin
Sandeep Mewara8-Aug-10 6:29
mveSandeep Mewara8-Aug-10 6:29 
GeneralRe: get input text value on text change [modified] Pin
Shantanu Gupta 13378-Aug-10 7:03
Shantanu Gupta 13378-Aug-10 7:03 
GeneralRe: get input text value on text change Pin
Not Active8-Aug-10 7:35
mentorNot Active8-Aug-10 7:35 
QuestionAdobe plug-in IE browser Pin
nlarson116-Aug-10 8:45
nlarson116-Aug-10 8:45 
QuestionShow and hide DIV tag Pin
Dave McCool5-Aug-10 13:15
Dave McCool5-Aug-10 13:15 
AnswerRe: Show and hide DIV tag Pin
Not Active5-Aug-10 15:18
mentorNot Active5-Aug-10 15:18 
AnswerRe: Show and hide DIV tag Pin
NeverHeardOfMe5-Aug-10 21:56
NeverHeardOfMe5-Aug-10 21:56 
AnswerRe: Show and hide DIV tag Pin
koolprasad20039-Aug-10 21:18
professionalkoolprasad20039-Aug-10 21:18 
Questionsend email with no further parameters Pin
Hemant Thaker5-Aug-10 0:49
Hemant Thaker5-Aug-10 0:49 
AnswerRe: send email with no further parameters Pin
Sandeep Mewara8-Aug-10 3:21
mveSandeep Mewara8-Aug-10 3:21 
QuestionHow to close all pop-up on click on logout Pin
InderK4-Aug-10 8:01
InderK4-Aug-10 8:01 
AnswerRe: How to close all pop-up on click on logout Pin
Not Active4-Aug-10 8:45
mentorNot Active4-Aug-10 8:45 
GeneralRe: How to close all pop-up on click on logout Pin
InderK4-Aug-10 18:07
InderK4-Aug-10 18:07 
GeneralRe: How to close all pop-up on click on logout Pin
Not Active5-Aug-10 2:21
mentorNot Active5-Aug-10 2:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.