JavaScript Trouble with transitioning background Image with JQuery trouble transitioning out of swaddle,trouble transitioning from one activity

Edit

I figured out that it is actually fading out, it just removes the background image before it starts the fade so I can't see it...duh. I just removed the .css('background','') so it fades out now. Some of my css styles still are not affecting it though. Somehow it is getting a background-repeat: initial; put on it that is overriding the class styles. Is this because the js is acting on its styling?


Original:

I have read through some other questions on here and they helped me get this far, but I am still not seeing a solution.

I am having trouble with fading background images on hover. I am storing image urls as data attributes of a list of links. When you hover on the link, the background of another div is set to be the respective image through jquery.

I have gotten the background image to be assigned, added a class to make it visible. It works fading in, but not out. When I manually remove the visibility class while in chrome dev tools it fades out as expected, but not when the jquery removes it. other "background-" css styles are not working either unless I add an !Important. I cannot tell what is overriding them though.

JSFiddle

HTML

<div class="backdrop"></div>
<ul>
    <li><a target='_blank' href="#" class="item" data-img="http://goo.gl/hbKhMi">one</a></li>
    <li><a target='_blank' href="#" class="item" data-img="http://goo.gl/7p0Kki">two</a></li>
    <li><a target='_blank' href="#" class="item" data-img="http://goo.gl/EHW4Xs">three</a></li>
</ul>

CSS

.backdrop {
    width:450px;
    height:400px;
    opacity: 0;
    -webkit-transition: opacity 0.75s;
    transition: opacity 0.75s;
    background-position:center;
    background-repeat: no-repeat;
}

.visable{
      opacity:1;
}

JS

$(document).ready(function() {
    $('.item').mouseenter(function() {
        $('.backdrop').css('background','url('+$(this).data("img")+')').addClass('visable');
    });
    $('.item').mouseleave(function() {
        $('.backdrop').css('background', '').removeClass('visable');
    });
});
Answer:1

Can someone give me an example of how to make an ajax call by JQuery within an HTML page to a Java Servlet (please post the full code of the html page, the call and the Servlet Class). I want to do ...

Can someone give me an example of how to make an ajax call by JQuery within an HTML page to a Java Servlet (please post the full code of the html page, the call and the Servlet Class). I want to do ...

  1. jquery ajax java servlet example
  2. jquery post java servlet
  3. jquery datatables java servlet example
  4. jquery call java servlet
  5. jquery to java servlet
  6. jquery ajax post java servlet
  7. jquery file upload java servlet example
  8. jquery file upload java servlet
  9. jquery validate remote java servlet
  10. jquery ajax jsp servlet java example
  11. jquery ajax request to java servlet
  12. jquery ajax java servlet
  13. jquery ajax json java servlet example
  14. jquery java servlet example

In this Post How to move to prev/next element of an array its telling how to move prev/next a array ellement. But i want the same concept for Prev/Next Array Element Key. Ex: var arr = new Array(); ...

In this Post How to move to prev/next element of an array its telling how to move prev/next a array ellement. But i want the same concept for Prev/Next Array Element Key. Ex: var arr = new Array(); ...

Im using jTable to display CDs info and a child table to show reviews of that CD. I want to be able to only show the edit\delete buttons on the rows for the user that is logged in. I have been trying ...

Im using jTable to display CDs info and a child table to show reviews of that CD. I want to be able to only show the edit\delete buttons on the rows for the user that is logged in. I have been trying ...

I need some help to fix an error on this code: var image = new Array (); image[0] = "http://placehold.it/20"; image[1] = "http://placehold.it/30"; image[2] = "http://placehold.it/40"; image[3] = "...

I need some help to fix an error on this code: var image = new Array (); image[0] = "http://placehold.it/20"; image[1] = "http://placehold.it/30"; image[2] = "http://placehold.it/40"; image[3] = "...

  1. random image on refresh website
  2. random image on refresh
  3. random image on refresh html code
  4. random image on refresh php
  5. random background image refresh
  6. html random image on refresh
  7. javascript random image on refresh
  8. random image every time you refresh