question about widgets

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

question about widgets

Karl Tiedt
I'm actually diving into "creating" a widget... I havent been able to
find what I needed, so I'm taking the SlideShow widget and using it as
a reference in creating a new widget.... Quick description...

I'm calling it HtmlImageBanner as its purpose is to take a background
image, and to fade in "x" random images... so an banner 800 pixels
wide could have 5 different 160 pixel "banners" rotating in over it...
my question is since I want to try and keep this as "expandable" as
possible, I've let a spot where you can define the # of banners to
create over the background..
this of course means I now have an "unknown" number of img items to
create... if I use eval inside of a loop, will that work? (I remember
there being some weird issues with eval... thats why I'm asking) and
in conjunction with that...if I do an eval like "var tempObj =
eval("this.tile"+i); and then set properties on tempObj will that work
for setting properties of the newly created this.tileX objects?

Thats all I can think of for now... :)
Thanks!!
--
-Karl Tiedt
_______________________________________________
Dojo-interest mailing list
[hidden email]
http://dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|

Re: question about widgets

Bill Keese-2
Hi Karl,

I'm not sure why you are talking about eval.  Does "img items" mean
image domnodes? You can just do:

for(var i=0;i<10;i++){
        var img document.createElement("img");
        this.domNode.appendChild(img);
}

(or something like that)
Probably I didn't understand what you were saying.

Bill

Karl Tiedt wrote:

> I'm actually diving into "creating" a widget... I havent been able to
> find what I needed, so I'm taking the SlideShow widget and using it as
> a reference in creating a new widget.... Quick description...
>
> I'm calling it HtmlImageBanner as its purpose is to take a background
> image, and to fade in "x" random images... so an banner 800 pixels
> wide could have 5 different 160 pixel "banners" rotating in over it...
> my question is since I want to try and keep this as "expandable" as
> possible, I've let a spot where you can define the # of banners to
> create over the background..
> this of course means I now have an "unknown" number of img items to
> create... if I use eval inside of a loop, will that work? (I remember
> there being some weird issues with eval... thats why I'm asking) and
> in conjunction with that...if I do an eval like "var tempObj =
> eval("this.tile"+i); and then set properties on tempObj will that work
> for setting properties of the newly created this.tileX objects?
>
> Thats all I can think of for now... :)
> Thanks!!
> --
> -Karl Tiedt
> _______________________________________________
> Dojo-interest mailing list
> [hidden email]
> http://dojotoolkit.org/mailman/listinfo/dojo-interest
_______________________________________________
Dojo-interest mailing list
[hidden email]
http://dojotoolkit.org/mailman/listinfo/dojo-interest