you are in: codestackercodes [RSS] → tag: hack [RSS]

[prototype] adding input:focus functionality to ie Delicious

show/hide lines
   1  Event.observe(window, 'load', function() { 
   2  var fields = $$("input"); 
   3  for (var i = 0; i fields[i].onfocus = function() {this.className += ' focused';} 
   4  fields[i].onblur = function() {this.className = this.className.replace('focused', '');} 
   5  } 
   6  }); 
   7  
   8  // in css, paste
   9  // input:focus, /* works in FF without javascript */ 
  10  // input.focused /* used by js */ 
  11  // { background-color: #f7cd72; } 
created by leozera — 18 November 2008 — get a short url — tags: hack ie6 javascript prototype embed

ie conditional hack Delicious

show/hide lines
   1  <!--[if IE]>
   2  	<link rel="stylesheet" type="text/css" href="ie-only.css" />
   3  <![endif]-->
   4  
   5  # Embedded CSS
   6  <!--[if IE]>
   7    <style type="text/css">
   8      #container {font-family: arial,verdana,sans-serif,tahoma;}
   9    </style>
  10  <![endif]-->
  11  
  12  # The opposite technique, targeting only NON-IE browsers:
  13  <!--[if IE]>
  14  	<link rel="stylesheet" type="text/css" href="ie-only.css" />
  15  <![endif]-->
  16  
  17  # Target specific versions of IE
  18  # IE 7 ONLY:
  19  <!--[if IE 7]>
  20  	<link href="IE-7-SPECIFIC.css" rel="stylesheet" type="text/css">
  21  <![endif]-->
  22  
  23  # IE 6 ONLY:
  24  <!--[if IE 6]>
  25  	<link rel="stylesheet" type="text/css" href="IE-6-SPECIFIC.css" />
  26  <![endif]-->
  27  
  28  # IE 5 ONLY:
  29  <!--[if IE 5]>
  30  	<link rel="stylesheet" type="text/css" href="IE-5-SPECIFIC.css" />
  31  <![endif]-->
  32  
  33  # IE 5.5 ONLY:
  34  <!--[if IE 5.5000]>
  35  <link rel="stylesheet" type="text/css" href="IE-55-SPECIFIC.css" />
  36  <![endif]-->
  37  
  38  # VERSION OF IE VERSION 6 OR LOWER: (I find this one pretty handy)
  39  <!--[if lt IE 7]>
  40  	<link rel="stylesheet" type="text/css" href="IE-6-OR-LOWER-SPECIFIC.css" />
  41  <![endif]-->
created by leozera — 17 September 2008 — get a short url — tags: css hack ie embed

another ie 6 hack Delicious

show/hide lines
   1  p {			
   2  	background: green !important; /* Major browsers other than IE 6 and below respect the importance immediately */
   3  	background: red; /* IE 6 and below use this value instead, even though the above was marked as important */
   4  }
created by leozera — 23 July 2008 — get a short url — tags: css hack ie ie6 embed

1kb ie 6 png fix hack Delicious

create a 1×1 ‘clear.gif’ image

show/hide lines
   1  var clear="images/clear.gif" //path to clear.gif
   2  
   3  pngfix=function(){var els=document.getElementsByTagName('*');var i_p=/\.png/i;var i=els.length;while (i-- >0){var el=els[i];var es=el.style;if(el.src&&el.src.match(i_p)&&es.filter==''){el.height = el.height;el.width = el.width;es.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+el.src+"',sizingMethod='crop')";el.src = clear;}else{var elb=el.currentStyle.backgroundImage;if(elb.match(i_p)){var path=elb.split('"');var rep=(el.currentStyle.backgroundRepeat=='no-repeat')?'crop':'scale';es.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+path[1]+"',sizingMethod='"+rep+"')";es.height=el.clientHeight+'px';es.backgroundImage="none";}}if (el.currentStyle.position!='absolute' && !es.filter && !el.tagName.match(/(body|html|script)/gi)) es.position="relative";if (es.filter&&el.currentStyle.position=="relative") es.position="static";}}
   4  window.attachEvent('onload',pngfix);
created by leozera — 17 July 2008 — get a short url — tags: browser css hack ie6 js embed

another min-height hack Delicious

http://www.dustindiaz.com/min-height-fast-hack/

show/hide lines
   1  selector {
   2    min-height:500px;
   3    height:auto !important;
   4    height:500px;
   5  }
created by leozera — 17 July 2008 — get a short url — tags: css hack ie embed