[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Preloading Images

Subject: Re: Preloading Images
From: "Sia Rahimi" <sia_rahimi@xxxxxxxxxxx>
Date: Tue, 18 Jul 2000 00:00:32 PDT
body preload images
Thank you sir, that worked fantastic.


From: Dan Morrison <dman@xxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxx
To: xsl-list@xxxxxxxxxxxxxxxx
Subject: Re: Preloading Images
Date: Tue, 18 Jul 2000 13:37:16 +1200

Sia Rahimi wrote:

> I would like to generate the following html snippet:
> <body bgcolor="#ffffff" onLoad="PreloadImages
> ('images/image1.gif','images/image2.gif','images/image3.gif');">

I would predict a few headaches getting your quoting right using that
approach. It can be done (reasonably easily) but I'd advise stepping out
of the onload to get it done.

<body bgcolor="#ffffff" onLoad="doPreloadImages()" >

function doPreloadImages(){

This means you won't have to contend with nested "''"

A template could be of the form:

<xsl:template match="LeftNavList">
    function doPreloadImages(){
    <xsl:for-each select="PreLoadImage">
      Preload('<xsl:value-of select="." />');

Advantages include clearer readability (IMO, although it can be compressed back into your original PreloadImages(..,..,..) if you prefer) and it means the LeftNavList can be matched at any point in the page, instead of attaching itself to the 'body' template.

There are more elaborate (generic) approaches and also more succinct
ways, like your original, but hopefully this will give you enough



:=====================:====================: : Dan Morrison : The Web Limited : : http://here.is/dan : http://web.co.nz : : dman@xxxxxxxx : danm@xxxxxxxxx : : 04 384 1472 : 04 495 8250 : : 025 207 1140 : : :.....................:....................: : If ignorance is bliss, why aren't more people happy? :.........................................:

XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list

________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.