Top Left Text cha

Web & App Development

Actually, I was thinking that would be simple. But, if I set a default image using CSS, it will always jump back to it when you move your mouse off the link. And I'm thinking you would want it to stay on whatever you rolled over last. I hate to yank you from one language to another, but I think jQuery is actually the best way to address this (along with CSS). And it's actually very simple... you can probably look at it and figure out what's going on. And it's not exactly the best practice, but you can put jQuery in an article I believe (otherwise you would put it in a module - positioned at the bottom of the page somewhere). Same with the CSS... it's not the best practice, but you can put it in the article between <style></style>.

Another note on jQuery... it's normally included in Joomla, but it will probably have conflicts... therefore you will need to load jQuery noConflict (actually, this is also usually included in Joomla). So if you have any conflicts, which you probably will, you'll need to add the first line:

var jQ = jQuery.noConflict(true);

And change all instances of the $ (dollar sign) to jQ

Here's the link again to what it does now: New Example

And the code:
I also threw it in jsFiddle so you can experiment with it if you want... JS Fiddle (but had to use colors instead of background images for it to work locally on jsfiddle)

.container>div {
.container>#containerImage {
background-color: #9ea1ff;
.container>.imageLinks {
width: 300px;
background: #0c86ff;
.imageLinks>a {
display: block;
padding: 4px 8px;
border: 1px solid #000;
margin: 10px;
.container>.defaultImage {
background:url('/images/default.jpg') no-repeat;
.container>.showImage1 {
background:url('/images/image1.jpg') no-repeat;
.container>.showImage2 {
background:url('/images/image2.jpg') no-repeat;
<script src=""></script>
<div class="container">
<div id="containerImage" class="defaultImage"></div>
<div class="imageLinks">
<a id="link1" href="/">First Link</a>
<a id="link2" href="/">Second Link</a>
function () {
$('#containerImage').removeClass(); /* removes all existing classes first */
$('#containerImage').addClass('showImage1'); /* and adds this new class */

function () {



0 #1 Timothy Johns 2015-07-14 16:11
So the noConflict version of the jQuery would look like:

var jQ = jQuery.noConflict(true);
function () {
jQ('#containerImage').removeClass(); /* removes all existing classes first */
jQ('#containerImage').addClass('showImage1'); /* and adds this new class */

function () {

Add comment

Security code

  • No comments found

Leave your comments

Post comment as a guest

Your comments are subjected to administrator's moderation.