I want the 4 big icons at the bottom to change to a green color when a user hovers over them. It’s also important that they
‘fade’ to green as oppose to just switching. I’m also using Wordpress, if that makes any difference.
Should I/Can I use Sprites? Or just a basic hover function?
Here is an example of the html that I’m using for one of the icons in the footer widgets section:
<!-- START #footer -->
<footer id="footer" >
<!-- START .footer-widgets -->
<div class="footer-widgets container_12 group">
<ul class="grid_3">
<li id="text-4" class="widget widget_text"><h4 class="widgettitle">OPTIMIZE</h4> <div class="textwidget"><p><img src="http://www.tadpolemarketing.ca/wp-content/uploads/2011/10/optimize-widget.png"><br />
when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.</p>
</div>
</li> </ul>
For starers, you can’t change an IMG on hover per sé, as IMGs are content.
So that being said you can use ANY APPROPRIATE method to change the BG image of any element. I’d suggest …since I assume you are tied down to the code you provided by your CMS and can actually optimize it, that you put the image as the BG of the H3
assuming all your widget images are 230x190px you can make a grid and join them unto one singe HORIZONTAL sprite (1840px x190px), the first 4(920px) will the image in the off state, the rest IN THE SAME ORDER, but in the HOVER state.
your markup will be more like this (not the image is no longer content)
<div class="footer-widgets container_12 group">
<ul class="grid_3">
<li id="text-1" class="widget widget_text">
<h4 class="widgettitle">OPTIMIZE</h4>
<p>when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.</p>
</li>
</ul>
</div>
I’m using Wordpress, so right now I just drag and drop the html widgets through the dashboard and it automatically populates… So, yeah. I’m kind of lost.
You haven’t added the ids either to the html so they are not being targeted. The html needs to look like this:
<div class="footer-widgets container_12 group">
<ul class="grid_3">
<li class="widget widget_text" [B]id="text-1">[/B]
<h4 class="widgettitle">test</h4>
<div class="textwidget">
<p>test text</p>
</div>
</li>
</ul>
<ul class="grid_3">
[B]<li id="text-2">[/B]
<h4>Widgetized Area2</h4>
</li>
<li>
<p>Go to Appearance - Widgets section to overwrite these sections. Use any widgets that fits you best. This is called <strong>Bottom 2</strong>. </p>
</li>
</ul>
<ul class="grid_3">
[B] <li id="text-3">[/B]
<h4>Widgetized Area3</h4>
</li>
<li>
<p>Go to Appearance - Widgets section to overwrite these sections. Use any widgets that fits you best. This is called <strong>Bottom 3</strong>. </p>
</li>
</ul>
<ul class="grid_3">
[B]<li id="text-4">[/B]
<h4>Widgetized Area4</h4>
</li>
<li>
<p>Go to Appearance - Widgets section to overwrite these sections. Use any widgets that fits you best. This is called <strong>Bottom 4</strong>. </p>
</li>
</ul>
</div>
You can’t really do a fade effect on a background image with css alone. You could use CSS3 transitions but you would need to start with a reduced opacity and then make it fully opaque on hover.
oops, the missing negative was my bad ( that’s what I get for coding directly on the QR window).
It’s next to impossible to analyze a widgets output w/o the widgets source code.
HOWEVER i would appear to me that your H4 and your content are ending up as different LIs, delete the RED text, add the GREEN text:
<li [COLOR="#008000"]<? echo "id='text-$i'";?>[/COLOR]><h4><?php _e('Widgetized Area', 'echo'); echo ' ' + $i; ?></h4>[COLOR="#FF0000"]</li>
<li>[/COLOR]
<p><?php _e('Go to Appearance - Widgets section to overwrite these sections. Use any widgets that fits you best. This is called ', 'echo'); ?>
<strong><?php _e('Bottom', 'echo'); echo ' ' . $i; ?></strong>.
</p>
</li>
RUN this, then VIEW SOURCE. Look for the sequence of “id=‘text-??’” it could begin with 0/1 but it should be sequential, that’s what you need to name the IDs in your CSS.
Ok, I made the changes to the CSS, and then removed/added the code Dresden mentioned- and still doesn’t work…
Here’s the code that the source spits out:
<div class="footer-widgets container_12 group">
<ul class="grid_3">
<li id="text-3" class="widget widget_text"><h4 class="widgettitle">test</h4> <div class="textwidget"></div>
</li> </ul>
<ul class="grid_3">
<li id='text-2'><h4>Widgetized Area2</h4>
<p>Go to Appearance - Widgets section to overwrite these sections. Use any widgets that fits you best. This is called
<strong>Bottom 2</strong>.
</p>
</li>
</ul>
<ul class="grid_3">
<li id='text-3'><h4>Widgetized Area3</h4>
<p>Go to Appearance - Widgets section to overwrite these sections. Use any widgets that fits you best. This is called
<strong>Bottom 3</strong>.
</p>
</li>
</ul>
<ul class="grid_3">
<li id='text-4'><h4>Widgetized Area4</h4>
<p>Go to Appearance - Widgets section to overwrite these sections. Use any widgets that fits you best. This is called
<strong>Bottom 4</strong>.
</p>
</li>
</ul>
</div>
<!-- END .footer-widgets -->
So it goes text-3, text-2, text-3, text-4.
The other thing that I was going to suggest… I don’t really have to do this through the widgets output at all, since I can just edit the footer code directly. So if you guys have any recommendations of exactly how it should appear as an output in the footer, I can just use that.
(e.g. see what the output source code is for the original layout of the 4 widget boxes, then tweak the output code to do what I need it to, then copy paste that directly into the footer, removing any PHP)
Bah, sorry- I’m in way over my head… I kind of know how to ‘read’ this stuff (like how I can ‘read’ french), but not write it at all.
The code I gave you was a working example and fully functional. You just had to copy the css and then add the ids where I stated. No other changes were necessary.
You have failed to copy my CSS code properly and have left in place all the typos and incorrect rules.
.footer-widgets h4 { padding-bottom:190px,
That final comma will cause the rule to be broken. it should be a semi-colon ;