looks like a basic javascript question to me but here goes anyway.

Stop trying to put everything in the event

context = "<c:url value="/" />";
imgdir = context + "/images/";

//perhaps create an array to preload.
images = ["inico"];

function mover(name) {
        document.images[name].src = imgdir + name +"-over.gif";
}

function mout(name) {
        document.images[name].src =  imgdir + name +".gif";
}

<html:link page="/foo.do" linkName="inicio"
                onmouseover="mover('inicio')"
                onmouseout="mout('inicio')" ..



On 16 Mar 2004, at 08:00, [EMAIL PROTECTED] wrote:


Try using <html:rewrite page='/images/inicial.gif'/>


 Subramaniam Olaganthan
 Tata Consultancy Services
 Mailto: [EMAIL PROTECTED]
 Website: http://www.tcs.com




Joao Batistella <[EMAIL PROTECTED]>


03/16/2004 12:35 AM


Please respond to "Struts Users Mailing List" <[EMAIL PROTECTED]>



To
'Struts Users Mailing List' <[EMAIL PROTECTED]>

cc

Subject
Context relative URL







Hello!

 I have the following HTML img tag:
 <html:img page="/images/inicial.gif" border="0"
          onmouseover="this.src='/images/inicio-over.gif'"
          onmousedown="this.src='/images/inicio-down.gif'"
          onmouseout="this.src='/images/inicio.gif'"/>

The problem is that the page attribute is ok, img tag add the app context
before de page attribute and the image appears. But the others images in the
javascript events dosn't appear because struts doesn't put the app context
before the address.
I got the following HTML:


 <img src="/myapp/images/inicio.gif" border="0"
                 onmouseover="this.src='/images/inicio-over.gif'"
                 onmouseout="this.src='/images/inicio.gif'"
                 onmousedown="this.src='/images/inicio-down.gif'">

How can I have this generated with all the images with myapp before the
source of the image? Like this:
<img src="/myapp/images/inicio.gif" border="0"
                onmouseover="this.src='/myapp/images/inicio-over.gif'"
                onmouseout="this.src='/myapp/images/inicio.gif'"
                onmousedown="this.src='/myapp/images/inicio-down.gif'">


 Thanks,
 JP

ForwardSourceID:NT00006182    
<InterScan_Disclaimer.txt>--------------------------------------------- ------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to