Archive for November, 2008

Make transparent backgrounds under ie6 using iframes

To make an iframe transparent with the old ie6 you have to

1. add this parameter in the iframe

ALLOWTRANSPARENCY='true'

2. in the open file (inside iframe) add this line in the <head>

<style type="text/css"><!-- BODY {background:none transparent;}--></style>

Internet Explorer 6 do not support transparency in *.png images, but there are some javascripts to fix this issue.
google pngfix.js or iepngfix.htc to get one.

Code admin 21 Nov 2008 No Comments

Change background color using onmouseover and CSS

If you want to change the background or if you want to change the border (color, width, etc ) of a object there are a easy and quick way (no images) to do it

1. you have to create a box as

<a href='url' id='objbox'>
  <div >all you want inside</div>
</a>

2. then, in CSS add this code:

/* avoid underline on text*/
#objbox{
  text-decoration: none;
}
/* the box details */
#objbox div{
  font:normal 12px verdana,arial,helvetica;
  color:#CCC;
  background:#000;
  border:1px solid #FC0;
  width:100px;
  height:100px;
}
/* the "onmouseover" details */
#objbox:hover div{
  background:#000;
  border:1px solid #F00;
}

Thats all!

Code admin 20 Nov 2008 No Comments

get DIV attributes in javascript

in a DIV object as

<div id='idref' value1='some word' value2='blabla'> </div>

and you wat to get the parameter value1 and value2,
the next code will help you

// get the object ------
function getobj(objname){
  if (document.all){
    return document.all(objname);
  }else if (document.getElementById){
    return document.getElementById(objname);
  }
  return false;
}
//get the attibute------
function getAttr(idref,attr){
  var divobj = getobj(idref);
  return divobj.attributes[attr].value;
}

Code admin 19 Nov 2008 No Comments