[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: embedding xsl within javascript
Hi Rob - My second post! =) 1. You could attempt to create a wrapper onmouseover/onmouseout function. Do not use CData around it. example: function mm_swapimage_wrapper(paramImgSrc) { myImg.src = <xsl:value-of select="$ImgDir" /> + paramImgSrc; MM_swapimage('a1', '', myImage.src); } working example: http://www.suodenjoki.dk/us/productions/articles/photo_gallery.htm 2. Modify you current <a> tag <a href="about.asp?page=1"> <xsl:attribute name="onmouseover"> MM_swapImage('a1', '', '/ <xsl:value-of select="$ImgDir"/>/about/about1_on.gif',1) about/about1_on.gif') </xsl:attribute> </a> 3. Same as #2, only cleaner. Create an XSLT file that updates your XML, to include the whole onmouseover parameter for each image. Or you could just rewirte your XML file or your XML generation process. Then, your <a> is even easier! <a href="about.asp?page=1"> <xsl:attribute name="onmouseover"> <xsl:value-of select="mouse_over_event"/> </xsl:attribute> </a> working example of my own here: http://www.frettefamily.com/xml/galleries.xml (not all links work because it's still under construction so to speak.) I hope this helps, - Dave --- Rob Bradley <rob@xxxxxxxxxxxxxxxxxxxx> wrote: > hi there, my first post here - how exciting... ;) > > within my xsl I have the following basic rollover functionality > > ---- > <a href="about.asp?page=1" > onmouseover="MM_swapImage('a1','','/images/about/about1_on.gif',1)" > onmouseout="MM_swapImgRestore()"><img src="/images/about/about1.gif" > border="0" name="a1"/></a> > ---- > > I want to add a parameter to the image path, which is straightforward if its > just around the <img> tag: > > ---- > <xsl:attribute name="src"><xsl:value-of > select="$ImgDir"/>about/about1_on.gif</xsl:attribute></img> > ---- > > but what within javascript statements? like in the mouseover state above? > how do I add the $ImgDir > into the image path? > > many thanks > > rob > > __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|