Credit Card Debt Consolidation - Pontins - Easy movies download - Mortgages - Fast Loans

PDA

View Full Version : How can i make this Automatic function disabeldivs pls help mee


jemy
Jan 27th 2008, 10:21 pm
hello i amm not good in java script but can som1 help me pls to mmake this div "shadow" automatic here i can make it in iframe "onclick" when i click first buton and to remmove that with second buton but i want that to be automatic when i login in page adn do not removed.....pls help here you have my page i like to move butons and that to be all atime shadowed here is my page (http://206.51.231.44/~safewhee/helpme.htm)


and this is my code <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<SCRIPT type=text/javascript>
cDivs = new Array();
function disableDivs()
{
d = document.getElementsByTagName("BODY")[0];
for(x=0;x<arguments.length;x++)
{
if (document.getElementById(arguments[x]))
{
xPos = document.getElementById(arguments[x]).offsetLeft;
yPos = document.getElementById(arguments[x]).offsetTop;
oWidth = document.getElementById(arguments[x]).offsetWidth;
oHeight = document.getElementById(arguments[x]).offsetHeight;
cDivs[cDivs.length] = document.createElement("DIV");
cDivs[cDivs.length-1].style.width = oWidth+"px";
cDivs[cDivs.length-1].style.height = oHeight+"px";
cDivs[cDivs.length-1].style.position = "absolute";
cDivs[cDivs.length-1].style.left = xPos+"px";
cDivs[cDivs.length-1].style.top = yPos+"px";
cDivs[cDivs.length-1].style.backgroundColor = "#999999";
cDivs[cDivs.length-1].style.opacity = .6;
cDivs[cDivs.length-1].style.filter = "alpha(opacity=60)";
d.appendChild(cDivs[cDivs.length-1]);
}
}
}
function enableDivs()
{
for (hippopotamus=0;hippopotamus<cDivs.length;hippopotamus++)
{
document.getElementsByTagName("BODY")[0].removeChild(cDivs[hippopotamus]);
}
cDivs = [];
}
</SCRIPT>
<BODY>
<DIV id=d1><IFRAME id=myframe style="OVERFLOW: visible" marginWidth=0
marginHeight=0
src="http://google.com"
frameBorder=0 width=409 scrolling=no height=21
target="_blank"></IFRAME></DIV><BR><INPUT onclick="disableDivs('d1')" type=button value="Disable Those Divs">
<INPUT onclick=enableDivs() type=button value="Remove Cover Divs"> </BODY></HTML>

locdev
Jan 28th 2008, 5:22 am
add
<script>disableDivs('d1')</script>
to the bottom of the page. or you can add a page onLoad event.

can you give more detaild info of what you need

jemy
Jan 28th 2008, 10:52 am
yes man its working great thnks a lot from you are a king thnks a lot but man i have 1 question can you help me to be that "shadow" in half of iframe not all cuse he take all of iframe so i wuld like to mix 2 colos .....half of "shadow" to be like it is "shadow" with #99999 color and half to be "red" shadow in same iframe "d1" ...... so pls man can you help here you have modifyed script thnks a lot man

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<SCRIPT type=text/javascript>
cDivs = new Array();
function disableDivs()
{
d = document.getElementsByTagName("BODY")[0];
for(x=0;x<arguments.length;x++)
{
if (document.getElementById(arguments[x]))
{
xPos = document.getElementById(arguments[x]).offsetLeft;
yPos = document.getElementById(arguments[x]).offsetTop;
oWidth = document.getElementById(arguments[x]).offsetWidth;
oHeight = document.getElementById(arguments[x]).offsetHeight;
cDivs[cDivs.length] = document.createElement("DIV");
cDivs[cDivs.length-1].style.width = oWidth+"px";
cDivs[cDivs.length-1].style.height = oHeight+"px";
cDivs[cDivs.length-1].style.position = "absolute";
cDivs[cDivs.length-1].style.left = xPos+"px";
cDivs[cDivs.length-1].style.top = yPos+"px";
cDivs[cDivs.length-1].style.backgroundColor = "#999999";
cDivs[cDivs.length-1].style.opacity = .6;
cDivs[cDivs.length-1].style.filter = "alpha(opacity=60)";
d.appendChild(cDivs[cDivs.length-1]);
}
}
}
function enableDivs()
{
for (hippopotamus=0;hippopotamus<cDivs.length;hippopotamus++)
{
document.getElementsByTagName("BODY")[0].removeChild(cDivs[hippopotamus]);
}
cDivs = [];
}
</SCRIPT>

<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY>
<DIV id=d1><IFRAME id=myframe
style="OVERFLOW: visible; WIDTH: 409px; HEIGHT: 207px" marginWidth=0
marginHeight=0 src="http://google.com" frameBorder=0 width=409 scrolling=no
height=21 target="_blank"></IFRAME></DIV><BR><script>disableDivs('d1')</script> </BODY></HTML>

locdev
Jan 28th 2008, 2:36 pm
try this
also reputation change is ppreciated if the solution helped you ;)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<SCRIPT type=text/javascript>
cDivs = new Array();
function disableDivs()
{
d = document.getElementsByTagName("BODY")[0];
for(x=0;x<arguments.length;x++)
{
if (document.getElementById(arguments[x]))
{
xPos = document.getElementById(arguments[x]).offsetLeft;
yPos = document.getElementById(arguments[x]).offsetTop;
oWidth = document.getElementById(arguments[x]).offsetWidth;
oHeight = document.getElementById(arguments[x]).offsetHeight;
cDivs[cDivs.length] = document.createElement("DIV");
cDivs[cDivs.length-1].style.width = oWidth+"px";
cDivs[cDivs.length-1].style.height = oHeight/2+"px";
cDivs[cDivs.length-1].style.position = "absolute";
cDivs[cDivs.length-1].style.left = xPos+"px";
cDivs[cDivs.length-1].style.top = yPos+"px";
cDivs[cDivs.length-1].style.backgroundColor = "#999999";
cDivs[cDivs.length-1].style.opacity = .6;
cDivs[cDivs.length-1].style.filter = "alpha(opacity=60)";
d.appendChild(cDivs[cDivs.length-1]);
cDivs[cDivs.length] = document.createElement("DIV");
cDivs[cDivs.length-1].style.width = oWidth+"px";
cDivs[cDivs.length-1].style.height = oHeight/2+"px";
cDivs[cDivs.length-1].style.position = "absolute";
cDivs[cDivs.length-1].style.left = xPos+"px";
cDivs[cDivs.length-1].style.top = yPos+oHeight/2+"px";
cDivs[cDivs.length-1].style.backgroundColor = "Red";
cDivs[cDivs.length-1].style.opacity = .6;
cDivs[cDivs.length-1].style.filter = "alpha(opacity=60)";
d.appendChild(cDivs[cDivs.length-1]);
}
}
}
function enableDivs()
{
for (hippopotamus=0;hippopotamus<cDivs.length;hippopotamus++)
{
document.getElementsByTagName("BODY")[0].removeChild(cDivs[hippopotamus]);
}
cDivs = [];
}
</SCRIPT>

<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY>
<DIV id=d1><IFRAME id=myframe style="OVERFLOW: visible; WIDTH: 409px; HEIGHT: 207px" marginWidth=0
marginHeight=0 src="http://google.com" frameBorder=0 width=409 scrolling=no
height=21 target="_blank"></IFRAME></DIV><BR><script>disableDivs('d1')</script>
<INPUT onClick="disableDivs('d1')" type=button value="Disable Those Divs" />
<INPUT onClick="enableDivs()" type=button value="Remove Cover Divs" />
</BODY></HTML>

jemy
Jan 28th 2008, 7:26 pm
hey man thnksssssssssss a lot you are king thnks a lot man its work perfekt youu helped me to much thnks a lot man i have just 1 question is it posible to cut example 10 % that to be black shadow and 90 % red shadow thnks man a lotttttttt

locdev
Jan 31st 2008, 7:16 am
sure easy

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<SCRIPT type=text/javascript>
cDivs = new Array();
function disableDivs()
{
d = document.getElementsByTagName("BODY")[0];
for(x=0;x<arguments.length;x++)
{
if (document.getElementById(arguments[x]))
{
xPos = document.getElementById(arguments[x]).offsetLeft;
yPos = document.getElementById(arguments[x]).offsetTop;
oWidth = document.getElementById(arguments[x]).offsetWidth;
oHeight = document.getElementById(arguments[x]).offsetHeight;
cDivs[cDivs.length] = document.createElement("DIV");
cDivs[cDivs.length-1].style.width = oWidth+"px";
cDivs[cDivs.length-1].style.height = oHeight/10+"px";
cDivs[cDivs.length-1].style.position = "absolute";
cDivs[cDivs.length-1].style.left = xPos+"px";
cDivs[cDivs.length-1].style.top = yPos+"px";
cDivs[cDivs.length-1].style.backgroundColor = "#999999";
cDivs[cDivs.length-1].style.opacity = .6;
cDivs[cDivs.length-1].style.filter = "alpha(opacity=60)";
d.appendChild(cDivs[cDivs.length-1]);
cDivs[cDivs.length] = document.createElement("DIV");
cDivs[cDivs.length-1].style.width = oWidth+"px";
cDivs[cDivs.length-1].style.height = (oHeight/10)*9+"px";
cDivs[cDivs.length-1].style.position = "absolute";
cDivs[cDivs.length-1].style.left = xPos+"px";
cDivs[cDivs.length-1].style.top = yPos+(oHeight/10)+"px";
cDivs[cDivs.length-1].style.backgroundColor = "Red";
cDivs[cDivs.length-1].style.opacity = .6;
cDivs[cDivs.length-1].style.filter = "alpha(opacity=60)";
d.appendChild(cDivs[cDivs.length-1]);
}
}
}
function enableDivs()
{
for (hippopotamus=0;hippopotamus<cDivs.length;hippopotamus++)
{
document.getElementsByTagName("BODY")[0].removeChild(cDivs[hippopotamus]);
}
cDivs = [];
}
</SCRIPT>

<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY>
<DIV id=d1><IFRAME id=myframe style="OVERFLOW: visible; WIDTH: 409px; HEIGHT: 207px" marginWidth=0
marginHeight=0 src="http://google.com" frameBorder=0 width=409 scrolling=no
height=21 target="_blank"></IFRAME></DIV><BR><script>disableDivs('d1')</script>
<INPUT onClick="disableDivs('d1')" type=button value="Disable Those Divs" />
<INPUT onClick="enableDivs()" type=button value="Remove Cover Divs" />
</BODY></HTML>


reputation + is appreciated if the solution helped you.