Hi Eric,

That technique only works when the tiddler is part of the permaview.
That is, if I click on my sample tiddler, the images come up with the
opaque background. But, if I make a permaview, and refresh the screen,
then the sample tiddler displays correctly. The technique I mentioned
previously, where the script is at the bottom of the tiddler, works
whenever a tiddler is opened.

Whether it works or not, the result is still a bit ugly, showing the
graphic but with a slight border and the little "no image" mark
(despite there being an image). Maybe that's what the shim is
about ... I'll have to read more.

But one more issue. Is there an id# or mechanism to avoid using
'body' ? Just the supersleight (ss) documentation recommends against
using 'body'. My first experiment with ss I used 'body', and ... maybe
just by coincidence ... ended up with a corrupt TW file.

Thanks!
Mark

On Aug 21, 7:55 am, Eric Shulman <[email protected]> wrote:
> > The easiest way to do this would be to add the jquery plugin to your
> > MarkupPrehead tiddler.
>
> > eg.
> > <script type='text/javascript' src='supersleight.js'></script>
>
> or, copy the source code from supersleight.js and paste it into a
> tiddler tagged with systemConfig (i.e., make it a plugin)
>
> > Then you'd need to make sure everytime your page is refreshed the
> > function is called
> > try something like this:
> > var oldrestart = restart;
> > restart = function(){
> >   jQuery('body').supersleight();
> >   oldrestart();};
>
> There is another way that you can invoke this function whenever the
> page is refreshed...
>
> Rather than hijacking the core's restart() function, you could create
> a tiddler called, for example, [[SiteStartup]], that would contain a
> tiny inline script [1] that calls the supersleight() initialization,
> like this:
>    <script> jQuery('body').supersleight(); </script>
> Then, transclude this tiddler at the end of the PageTemplate, like
> this:
>    <span macro='tiddler SiteStartup'></span>
> Each time the PageTemplate is rendered (i.e., when the whole TW page
> is drawn), the inline script in SiteStartup will be processed, and the
> supersleight() init function will be invoked.
>
> Alternatively, if you don't want to have a separate tiddler to hold
> the inline script, you could use a 'hidden section' in the
> PageTemplate itself, so that everything is in one place, like this:
>
> <span macro='tiddler PageTemplate##SiteStartup'></span><!--
> !SiteStartup
> <script> jQuery('body').supersleight(); </script>
> !end
> -->
>
> Note: there is an important (and useful) difference between using this
> inline script technique and using a standard 'systemConfig' tiddler
> (i.e., a plugin) to invoke custom code during startup: plugins get
> loaded in *before* the initial page content has been rendered, while
> the 'SiteStartup' scripts, being triggered at the end of the
> PageTemplate, are processed *after* the initial rendering has been
> completed.  Thus, startup *scripts* can be used to manipulate the
> rendered DOM elements, while plugins cannot.
>
> enjoy,
> -e
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to