xsl-list
[Top] [All Lists]

RE: embedding xsl within javascript

2004-07-29 16:13:52
sorry guys, ignore my last posting - it does work

(except for the {$ImgDir} which still doesn't parse)

yes option 3 is defo the best option, not completely sure
how to do it yet but I know what your saying

cheers geezas!

-----Original Message-----
From: dave frette [mailto:gohabitat(_at_)yahoo(_dot_)com] 
Sent: Thursday, July 29, 2004 8:05 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] 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(_at_)nowwashyourhands(_dot_)com> 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 

--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--