...

View Full Version : Transparency on/off button



grinchy
02-11-2004, 01:27 PM
hi can anyone help me.
i need a button which will turn on and off this piece of code.


<style>
.windowbg { background-color: transparent; }
.windowbg2 { background-color: transparent; }
.bordercolor { background-color: transparent; }
</style>

DsgnrsTLZAdmin
02-12-2004, 02:00 AM
use php.....

just create the variables and youll have it.





<?php
//create if statement
if ()
{
print "
<style>
.windowbg { background-color: transparent; }
.windowbg2 { background-color: transparent; }
.bordercolor { background-color: transparent; }
</style>
";
}
else
{
}
?>

grinchy
02-12-2004, 10:06 AM
that sounds good.
i can see how it would work but i know less about php than i do about html.
is there any chance that you could show me how to even just make a simple link style button to do this?

grinchy
02-12-2004, 01:37 PM
its ok i got it to work very well in html
the code is:
Headers


Code:<!-- please do not post anywhere else -->
<style>
div{background-color:red};
</style>
<style id="transparentStyleSheet">
.windowbg { background-color: transparent; }
.windowbg2 { background-color: transparent; }
.bordercolor { background-color: transparent; }
</style>
<script>
function toggleStyle()
{
var transparentStyleSheet = document.getElementById("transparentStyleSheet");
transparentStyleSheet.disabled = !transparentStyleSheet.disabled;
}
</script>



where you want the button


<!-- this is the button to turn on and off transparency --- place where you want-->

<div class="windowbg">I'm a div</div>

<button onclick="toggleStyle()" ID="Button1">Toggle Style</button>


http://nuigsc.proboards19.com



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum