Created
April 30, 2014 23:38
-
-
Save schickm/270ecbd3f1a508737d6a to your computer and use it in GitHub Desktop.
jQuery: changing up the css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<article> | |
<h2>Yet another headline</h2> | |
<a class="read-more" href="#">read more...</a> | |
<div class="more"> | |
<p>Another tasty story...</p> | |
</div> | |
</article> | |
<article> | |
<h2>Even another headline!!!!</h2> | |
<a class="read-more" href="#">read more...</a> | |
<div class="more"> | |
<p>This story is flippin amazin.</p> | |
</div> | |
</article> | |
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script> | |
<script type="text/javascript"> | |
$('.read-more').on('click', function() { | |
$(this).closest('article').find('.more').slideDown(); | |
return false; | |
}); | |
$('h2').on('mouseover', function() { | |
$(this).closest('article').find('.read-more').css({'font-size': '16px'}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment