I’m fairly new to the coding world and am currently working on my tribute page. I know that the assignment is fairly simple and requires an image with related text. Easy enough, but I’d like to spice mine up a bit more.
I want to have an image that, when the user hovers over it, will reduce the image opacity and have text appear over the image. I can successfully reduce the opacity but 1) Am having difficulty position caption text directly over the image and b) using jQuery to toggle the visibility.
I don’t know if I am biting off more than I can chew at my level, but now that I’ve started I am determined to solve this!! Here’s a link to my Codepen, or I can link the code in the comments.
The tribute page is looking a bit rough right now, but I’d like to work out the functionality before spicing it up a bit more.
I opened your pen and I saw that you were missing quotes in your jQuery. So, you may wanna comb through the lines first and make sure your classes and IDs are in the right places. Good luck
But it your HTML the h2 has a class not and ID of amiibo-caption so the css selector would be .amiibo-caption
Here’s a forked pen:
I changed the html a bit to make targeting the box easier (Gave the containing box an ID of amiibo-box)
<div id="amiibo-box" class="col-xs-4">
<img id="amiibo" src="https://static.giantbomb.com/forum/uploads/scale_small/0/1992/2862592-screen+shot+2016-06-16+at+12.33.23+am.png"
title="Griffin struggles to fit an Amiibo in his mouth.">
<h2 class= "amiibo-caption"> "Quote here from Griffin's Amiibo Corner."</h2>
</div>
I’m a big fan of the McElroy brothers as well, and though I would make my tribute page a little bit more goofy
Thanks so much! I have a much better understanding of how all of this works. I was told that this was possible in jQuery, hence me thinking that was the solution to follow.