21281 Posts in 5729 Topics by 2600 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 298 Views |
-
getting more control (or less?) over images

6 October 2011 at 1:23am
Guys
I want to output an image with an onmouseover effect (changing a large image for the one selected onmouseover from a list of thumbs).
<% control Resources %>
<% control Attachment %>
$CroppedImage(81,80)
<% end_control %>
<% end_control %>how do I get into do something like...
<% control Resources %>
<% control Attachment %>
<img src ="$attachment.url" onmousemove="somejavaScriptfnc()">
<% end_control %>
<% end_control %>as this just produces img src = "".
Thanks!
-
Re: getting more control (or less?) over images

6 October 2011 at 1:40am
If you're in the Attachment loop then skip the prefix.
It should just be<img src="$URL" onmousemove="somejavaScriptfnc()">
-
Re: getting more control (or less?) over images

6 October 2011 at 1:41am
I think you want to do something like this
<% control Resources %>
<% control Attachment %>
<img src ="<% control SetRatioSize(81,80) %>$URL<% end_control %>" onmousemove="somejavaScriptfnc()">
<% end_control %>
<% end_control %> -
Re: getting more control (or less?) over images

6 October 2011 at 2:08am
cool - thanks guys, both works, just personal preference how I end up doing it in the template. cheers!
-
Re: getting more control (or less?) over images

6 October 2011 at 7:55am
PROTIP: You can save yourself some lines of code by shortening the block to:
<% control Resources %>
<img src ="<% control Attachment.SetRatioSize(81,80) %>$URL<% end_control %>" onmousemove="somejavaScriptfnc()">
<% end_control %> -
Re: getting more control (or less?) over images

6 October 2011 at 10:31pm
I wouldn't over use the dot notation because the template will fail if not present, the control tag would not.
Also the dot notation cannot be chained nore than once (i think, so something.this is ok, but some.thing.else isn't ok).
| 298 Views | ||
|
Page:
1
|
Go to Top |





