Loading ...
Sorry, an error occurred while loading the content.

Re: Button component question regarding CSS formatting

Expand Messages
  • khromu
    Just to let everyone know I was not able to make this.setStyle( background ,.... work in Opera 9 (Linux) IE6 (runing in IE4Linux) so I used
    Message 1 of 4 , Jul 8, 2007
    • 0 Attachment
      Just to let everyone know I was not able to make
      this.setStyle("background",....
      work in Opera 9 (Linux) IE6 (runing in IE4Linux) so I used
      this.addClass('toolbar_expand');

      with worked in all.

      _LR_

      --- In ydn-javascript@yahoogroups.com, "thegridone" <thegridone@...>
      wrote:
      >
      > Hello !
      >
      > You were right, it works ! So thanks a lot! I've been on your site and
      > I must say that you're really doing a good job.
      >
      > OK, here's my code, just in case :
      >
      > ###############
      >
      > <script type="text/javascript">
      >
      > var allThumbnails;
      >
      > function initThumbnails()
      > {
      > allThumbnails = new Array(<%= MAX_THUMBS %>);
      > for (var num = 0; num < <%= MAX_THUMBS %> ; num++)
      > {
      > var thisOne = "myButtonId" + num;
      > allThumbnails[num] = new YAHOO.widget.Button({
      > id:"button" + num,
      > type: "button",
      > label: "My Button " + num,
      > container: "div" + num,
      > oninit: {fn: function () {
      > this.setStyle("background",
      > "url(media/a/"+num+".gif)
      > left center no-repeat;");
      > }}} ) }
      > return allThumbnails;
      > }
      > </script>
      >
      >
      > <body onload="initThumbnails();">
      >
      > <h1>Yahoo buttons</h1>
      >
      > <form id="myForm" method="post">
      >
      > <% for (int num = 0; num < MAX_THUMBS; num++) { %>
      > <div id="div<%= num %>" />
      > <% } %>
      > </form>
      > </body>
      >
      > #######################
      >
      >
      >
      > Cheers !
      >
      > Pierre
      >
      >
      >
      > --- In ydn-javascript@yahoogroups.com, Caridy PatiƱo Mayea
      > <caridy@> wrote:
      > >
      > > Hello Pierre:
      > >
      > > I think that this problem is related with the fact that the button
      > > creation process is based on the isAvailable event confirmation before
      > > create the button, and then you're trying to apply a style to an
      > > inexistent element... and the solution can be this:
      > >
      > > var bt = new YAHOO.widget.Button(element, {oninit: {fn:
      > > function () {
      > > this.addClass ('class1');
      > > this.setStyle ("background", "url(media/a/3.gif);");
      > > }
      > > }});
      > >
      > > In this example, you will apply a new class or style to the button
      > > inside the oninit function, and in this particular moment, the object
      > > was created and attached to the DOM structure...
      > >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.