I would have my xslt macro generate the javascript code. Then you can mix server-side and client-side logic for the best of both worlds!
Depending on where you need the macro output you might end up with two macros... one for the js and one for the gallery itself. Or you might do it all in one macro.
Ideally you would make the gallery out of html formatted items/markup ie: <ul id="gallery"><li><a><img ... and use a generic js script to loop through these items constructing the gallery, rather than building the gallery in js.
Firstly so your html is accesible even without js and secondly you will only need to loop through html items in XSLT and include a js file or two and maybe a short script snippet.
ie: Gallery XSLT exmaple using Gallerific and Tree Multi Picker (with lefteris output) and a custom img sizer...
Mixing Xslt and Javascript
Hi!
I know this can be made but not sure of the syntax. Im trying to make Jquery Crosslide Gallery and populate it from xslt.
How can I put the For each inside the javascript?
I would have my xslt macro generate the javascript code. Then you can mix server-side and client-side logic for the best of both worlds!
Depending on where you need the macro output you might end up with two macros... one for the js and one for the gallery itself. Or you might do it all in one macro.
cheers,
doug.
Hey Froad
Ideally you would make the gallery out of html formatted items/markup ie: <ul id="gallery"><li><a><img ... and use a generic js script to loop through these items constructing the gallery, rather than building the gallery in js.
Firstly so your html is accesible even without js and secondly you will only need to loop through html items in XSLT and include a js file or two and maybe a short script snippet.
ie: Gallery XSLT exmaple using Gallerific and Tree Multi Picker (with lefteris output) and a custom img sizer...
Hope this helps!
is working on a reply...