Hi
It doesn't know what 'image' is in that context.
Actually after inheritance, you have a button with attribute 'image' which
gets value from 'img' attribute if element.
You can get xul:button element via
document.getAnonymousNodes(this)[0]
so, you write something like
document.getAnonymousNodes(this)[0].style.width ='128px';
document.getAnonymousNodes(this)[0].style.height ='128px';

And if you change elements order (now you have only one element) you should
change indexes or get your button with childNodes
https://developer.mozilla.org/en/XUL_Tutorial%3aXBL_Example

On Mon, Sep 27, 2010 at 6:53 PM, Tom Brito <brito....@gmail.com> wrote:

> Hello folks,
>
> I have a Xul app that have buttons with images, and I want the images to
> grow when the button is focused.
>
> If I do it in a css file, it works nice:
>
> button:focus image {
>
>
>     width: 128px;
>
>
>     height: 128px;
>
> }
>
>  but if I try it in javascript, within my binder, it doesn't work:
>
> <binding id="appicon_bind">
>
>
>     <content>
>
>
>         <xul:button xbl:inherits="image=img" />
>
>
>     </content>
>
>
>     <handlers>
>
>
>         <handler event="focus">
>
>
>             <![CDATA[
>                 image.style.width='128px';
>                 image.style.height='128px';
>             ]]>
>         </handler>
>
>
>     </handlers>
>
> </binding>
>
>  Why it says *"image is not defined"*? Isn't this focus event occurring
> within the button object?
>
>
>
>
> ------------------------------------------------------------------------------
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing.
> http://p.sf.net/sfu/novell-sfdev2dev
> _______________________________________________
> XUL News Wire      - http://xulnews.com
> XUL Job Postings   - http://xuljobs.com
> Open XUL Alliance - http://xulalliance.org
> _______________________________________________
> xul-talk mailing list
> xul-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/xul-talk
>
>
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
XUL News Wire      - http://xulnews.com
XUL Job Postings   - http://xuljobs.com
Open XUL Alliance - http://xulalliance.org  
_______________________________________________
xul-talk mailing list
xul-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xul-talk

Reply via email to