I have a span with paypal button. I must make this paypal button avialable for pressing only after user confirms TOS. For this i think to lay over the span with the paypal button another div with unchecked checkbox, opacity and z-index. The user checks the checkbox and the layed over div gets such a z-index, so the span with paypal button will be over it and can be pressed.
I need something like
HTML
<div class="with_zindex">
<input type="checkbox">
<span class="here_is_paypal_button"></span>
</div>
CSS
.with_zindex{
background-color:#fafafa;
opacity: .5;
filter: alpha(opacity=50);
-moz-opacity: .5;
z-index:1000;
}
.with_zindex + input[type=checkbox]:checked {
z-index:-1000;
}
But this don’t work for me (there are only given first formattings, which are not chenged by checking / unchecking checkbox).
Suggestion
Instead, you can initially have the PayPal button disabled and you can enable it once the user clicks on the checkbox.
HTML (jQuery Version)
HTML (JavaScript Version)
Else if you insist on
z-index:You need to give
position: relative;forz-indexto work. And there is no negativez-index!Your required answer
HTML
CSS
Fiddle: http://jsfiddle.net/praveenscience/35cQz/