Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jan 2013
    Location
    Oregon
    Posts
    34
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Internet Explorer Transparent Background on Click with Jquery.

    I am trying to make it so that when a div is clicked it then gets a transparent background.

    Code:
    $(".homeelem").click(function () {
                $("#homeanim").css({borderBottomWidth:'1px', width:'915px',top:'360px'});
     });
    I am already using this code to change other css properties but just can't seem to change the background. I'd also prefer to have this work in Internet Explorer so RGBA or Opacity isn't what I'm looking for. Generally to do this in basic CSS I use:

    Code:
    <style type="text/css">
    background:transparent;
           filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#50000000,endColorstr=#80000000); 
           zoom: 1;
    </style>
    But I don't know how to implement this into Jquery. Any thoughts?
    Last edited by samuelito.mcf; 02-21-2013 at 07:20 PM.

  • #2
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    use css rules in conjunction with .addClass and .removeClass instead, save yourself a ton of headaches.

  • Users who have thanked DanInMa for this post:

    samuelito.mcf (02-21-2013)

  • #3
    New Coder
    Join Date
    Jan 2013
    Location
    Oregon
    Posts
    34
    Thanks
    5
    Thanked 0 Times in 0 Posts
    That's an awesome Idea. Can't believe I didn't think of that. Thanks!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •