[eluser]elaniobro[/eluser]
[quote author="Eason" date="1268272828"]@elaniobro:
Putting img() function as the second parameter of anchor() function, just like what you do, is also an elegant way to create image anchor, IMO. I use my own version of anchor_img() just to avoid loading the html helper.
For incoportating the onmouseover and onmouseout attributes, I think it should be ok to put them into the options array of img(), in the same way as other attributes, e.g., img(array('src'=>'...', 'onmouseover'=>'...', 'onmouseout'=>'...')). But I never try this before because I usually use jquery to define javascript events.[/quote]
Yea, I've tried adding the 'onmouseover'=>'...', 'onmouseout'=>'...' didn't work for me. I should look back into this, I am sure it was a syntax thing, there are a lot of ",' etc.. going on.
needs to get put into the array, I'd assume something like this:
Code:
<?= anchor('/thoughts/more/'.$row->id,
img(array(
'src'=>'img/thoughts/readmore_a.jpg',
'id'=>'readMore',
'border'=>'0',
'alt'=>'Read More'
)
),
array(
'onmouseover'=>'readMore.src='.base_url().'img/thoughts/readmore_b.jpg'.';'.'"',
'onmouseout'=>'readMore.src='.base_url().'img/thoughts/readmore_a.jpg'.';'.'"'
)
);
?>
yet nada
is the above syntax correct? I think so, not getting errors