Ok, finally some level of success, I managed to make it work more or less 
as intended using Jed Carty's random value plugin but with a slightly 
modified workflow.
I imported the mentioned plugin but used it directly in the CSS tiddler 
like this:

body.tc-body {background: url("media/backgrounds/background<$view field="
value"/>.jpg") no-repeat center center fixed;
background-size: cover; height: 100%;}

<$button>
<$action-randval $step=01 $field=value $lower=00 $upper=18/>
Change Background
</$button>

Only problem I found is number padding, could your plugin be modified to 
account for number padding?
I mean generating numbers like 01 02 03 04 instead of 1 2 3 4?

It still only changes on button press, which is a shame, now if only there 
was a method to call <$action-randval> on load...
Is this possible with 5.1.8, or by using any special tag?













On Thursday, 12 March 2015 19:34:23 UTC, Eric Shulman wrote:
>
> On Thursday, March 12, 2015 at 11:31:30 AM UTC-7, Jed Carty wrote:
>>
>> If you are going to use javascript there shouldn't be any trouble with 
>> the current version. The only place you can put raw javascript is in the 
>> head using $:/tags/RawMarkup, so just try making a tiddler with both 
>> scripts and tag it with $:/tags/RawMarkup and see what happens.
>>
>
> In this particular use-case (i.e, setting the background image at load 
> time), tagging *both* scripts with RawMarkup has a subtle twist: 
> "document.body" *does not yet exist* when the <head> of the document is 
> processed.  While you can *define* the ChangeIt(...) function in the head, 
> but you can't invoke it until document.body has actually been created.  To 
> work around this, while still using RawMarkup for both script pieces, you 
> can invoke the ChangeIt() function from within an "event listener" that 
> waits for the "load" event to complete... .like this:
>
> <script> 
>    window.addEventListener("load", ChangeIt, false);
> </script>
>
> enjoy,
> -e
> Eric Shulman
> TiddlyTools / ELS Design Studios
>
> "Inside TiddlyWiki: The Missing Manual"
>
> https://www.indiegogo.com/projects/inside-tiddlywiki-the-missing-manual/x/8816263
> Note: the IndieGogo funding campaign has ended,
> but direct fundraising continues below...
>
> YOUR DONATIONS ARE VERY IMPORTANT!
> HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...
>    http://TiddlyTools.github.com/fundraising.html#MakeADonation
>
> Professional TiddlyWiki Consulting Services...
> Analysis, Design, and Custom Solutions:
>    http://www.TiddlyTools.com/#Contact
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.

Reply via email to