Web Analytics Made Easy -
StatCounter Transparency on/off button - CodingForum

Announcement

Collapse
No announcement yet.

Transparency on/off button

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Transparency on/off button

    hi can anyone help me.
    i need a button which will turn on and off this piece of code.

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

  • #2
    use php.....

    just create the variables and youll have it.



    PHP Code:
    <?php
    //create if statement
    if  ()
    {
    print  
    "
    <style>
    .windowbg { background-color: transparent; }
    .windowbg2 { background-color: transparent; }
    .bordercolor { background-color: transparent; }
    </style>  
    "
    ;
    }
    else
    {
    }
    ?>
    ~Designer's Toolz~

    Comment


    • #3
      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?

      Comment


      • #4
        its ok i got it to work very well in html
        the code is:
        Headers
        Code:
        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
        Code:
        <!-- 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

        Comment

        Working...
        X