I don't think the "disabled" attribute works with anchor tags (except in
IE) (it works with buttons, but in that case, it's supposed to be
disabled="disabled"). Instead, you could remove the href, add an
onclick="return false;" attribute, or do something like:
$('#addressbook a').click(function(e) {e.preventDefault();});
Anthony
On Friday, February 3, 2012 3:57:54 AM UTC-5, Annet wrote:
>
> I am working on the cms part of an app. In the view I have <a></a>
> elements:
>
> <div id="addressbook" class="ez-box admin">
> <a href="{{=URL('addressbook','admin')}}">
> <img src="{{=URL('static','init/images/icons/ABIcon.png')}}"
> alt="some_text" width="78px" height="78px"/>
> <h4>Adresboek</h4>
> <p class="fs12">Uw adresboek card beheren.</p>
> </a>
> </div> <!-- ez-box -->
>
> When the user isn't logged in I want the <a></a> elements to be
> disabled, i.e not click able and set their opacity to .50
>
> This is what I tried:
>
> {{if not auth.is_logged_in():}}
> <script type="text/javascript">
> $(document).ready(function(){
> $('#addressbook a').attr('disabled','');
> $('#calendar a').attr('disabled','');
> $('#hub a').attr('disabled','');
> });
> </script>
> <style type="text/css">
> .admin {opacity: 0.5; filter:Alpha(opacity=50);}
> </style>
> {{pass}}
>
> The opacity bit works, the jQuery bit doesn't work, I hope one of you
> could provide me with the correct code to make this work.
>
>
> Kind regards,
>
> Annet