Tag Archive for explorer

hide ie image toolbar

<meta http-equiv="imagetoolbar" content="no" />

source

Detecting IE (mini)

IE='v'=='v'

//o var isIE = /*@cc_on!@*/false;

source

Find Viewport Height / Width, crossbrowser:

browser : {
IE : !!(window.attachEvent && navigator.userAgent.indexOf('Opera') === -1),
Opera : navigator.userAgent.indexOf('Opera') > -1,
WebKit : navigator.userAgent.indexOf('AppleWebKit/') > -1,
Gecko : navigator.userAgent.indexOf('Gecko') > -1
&& navigator.userAgent.indexOf('KHTML') === -1,

getViewHgt : function(){
return browser.IE ?
// IE Cases
// Test for IE 5-7 Quirks and IE 4
(!(document.documentElement.clientHeight)
|| (document.documentElement.clientHeight === 0)) ?
// IE 5-7 Quirks and IE 4 case
document.body.clientHeight :
//IE 6+ Strict Case
document.documentElement.clientHeight:
// Gecko and Other DOM compliant case
window.innerHeight;
},

getViewWdth : function(){
return browser.IE ?
// IE Cases
// Test for IE 5-7 Quirks and IE 4
(!(document.documentElement.clientWidth)
|| (document.documentElement.clientWidth === 0)) ?
// IE 5-7 Quirks and IE 4 case
document.body.clientWidth :
//IE 6+ Strict Case
document.documentElement.clientWidth:
// Gecko and Other DOM compliant case
window.innerWidth;
}

source

IE6 Double Margin Bug / Duplicate Characters Bug Fix using jQuery

$('*').each(function() {
if ($(this).css('float') !== 'none') {
$(this).css('display', 'inline');
}
});

source

Détection de la version d’Internet Explorer

<script>
function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
var rv = -1; // Return value assumes failure.
if (navigator.appName == 'Microsoft Internet Explorer')
{
var ua = navigator.userAgent;
var re  = new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");
if (re.exec(ua) != null)
rv = parseFloat( RegExp.$1 );
}
return rv;
}
function checkVersion()
{
var msg = "You're not using Internet Explorer.";
var ver = getInternetExplorerVersion();

if ( ver > -1 )
{
if ( ver >= 6.1 )
msg = "You're using a recent copy of Internet Explorer."
else
msg = "You should upgrade your copy of Internet Explorer.";
}
alert( msg );
}
</script>

source

Vertical-Align for Stubborn Browsers

#container{
display: table;
#position: relative;
overflow: hidden;
}
#hackouter {
#position: absolute;
#top: 50%;
display: table-cell;
vertical-align: middle;
}
#hackinner {
#position: relative;
#top: -50%;
}

source

IE 6 Transparent PNG Fix – SuperSleight

var supersleight	= function() {

var root = false;
var applyPositioning = true;

// Path to a transparent GIF image
var shim			= 'x.gif';

// RegExp to match above GIF image name
var shim_pattern	= /x.gif$/i;

var fnLoadPngs = function() {
if (root) {
root = document.getElementById(root);
}else{
root = document;
}
for (var i = root.all.length - 1, obj = null; (obj = root.all[i]); i--) {
// background pngs
if (obj.currentStyle.backgroundImage.match(/.png/i) !== null) {
bg_fnFixPng(obj);
}
// image elements
if (obj.tagName=='IMG' && obj.src.match(/.png$/i) !== null){
el_fnFixPng(obj);
}
// apply position to 'active' elements
if (applyPositioning && (obj.tagName=='A' || obj.tagName=='INPUT') && obj.style.position === ''){
obj.style.position = 'relative';
}
}
};

var bg_fnFixPng = function(obj) {
var mode = 'scale';
var bg	= obj.currentStyle.backgroundImage;
var src = bg.substring(5,bg.length-2);
if (obj.currentStyle.backgroundRepeat == 'no-repeat') {
mode = 'crop';
}
obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='" + mode + "')";
obj.style.backgroundImage = 'url('+shim+')';
};

var el_fnFixPng = function(img) {
var src = img.src;
img.style.width = img.width + "px";
img.style.height = img.height + "px";
img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')";
img.src = shim;
};

var addLoadEvent = function(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
};
}
};

return {
init: function() {
addLoadEvent(fnLoadPngs);
},

limitTo: function(el) {
root = el;
},

run: function() {
fnLoadPngs();
}
};
}();

// limit to part of the page ... pass an ID to limitTo:
// supersleight.limitTo('header');

supersleight.init();

source

CSS PNG Image Fix for IE

* html img,
* html .png{
azimuth: expression(
this.pngSet?this.pngSet=true:(this.nodeName == "IMG" && this.src.toLowerCase().indexOf('.png')>-1?(this.runtimeStyle.backgroundImage = "none",
this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.src + "', sizingMethod='image')",
this.src = "/style/images/transparent.gif"):(this.origBg = this.origBg? this.origBg :this.currentStyle.backgroundImage.toString().replace('url("','').replace('")',''),
this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.origBg + "', sizingMethod='crop')",
this.runtimeStyle.backgroundImage = "none")),this.pngSet=true
);
}

________
________
Also consider adding this conditional comment on your HTML page
________
________

<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="png_fix.css" />
<![endif]--

source

css for IE7 only

<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="ie7.css" />
<![endif]– >

source

//Call from JavaScript:
window.external.AddFavorite(location.href, document.title);

//Call from anchor:
<a href="JavaScript:window.external.AddFavorite(location.href, document.title);">Bookmark this site!</a>

source