1

I'm trying to get the two icons on the left to move to the left when hovering. Can anyone tell me why it's not working? here's the fiddle http://jsfiddle.net/JLfvz/ here's the HTML

<div id="socials">
  <a href="http://twitter.com/" title="Twitter" class="social"><img     src="http://www.dot.state.oh.us/groups/ohol/PublishingImages/twitter-icon.gif"  alt="Twitter"></a>
  <a href="http://facebook.com/" title="Facebook"><img src="images/fb.png" alt="Facebook"></a><br>
  <a href="http://youtube.com" title="You Tube" class="social"><img src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcRvpJGY5jiR_SO4Hp2d6unwHcR3J-2vHxYOQ_-rVs8ZxUW8Mn5T6UNI1i0L" alt="youtube"></a>
  <a href="http://linkdin.com" title="Linkd In"><img src="images/in.png" alt="linkdin"></a>

  </div>
1
  • Post your code in your question and don't attempt to sidestep the SO rule of doing so when linking to jsFiddle. Commented Jan 20, 2014 at 22:55

1 Answer 1

1

You need to update the css on the child img element, not the top-level a.social element:

$(document).ready(function(){
    $(".social").hover(function(){
        $(this).children().css("left","0");
    },function(){
        $(this).children().css("left","30px");
    });
});

Updated demo: http://jsfiddle.net/JLfvz/2/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.