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

Re: [ydn-javascript] Re: Add a Background to the Menu Tree

Expand Messages
  • Eric Miraglia
    nat_farfan, In your code sample, you aren t specifying a background image, as far as I can see. If you did, it should be specified as something like: #tree3
    Message 1 of 12 , Dec 27, 2006
    • 0 Attachment
      nat_farfan,

      In your code sample, you aren't specifying a background image, as far as I can see.  If you did, it should be specified as something like:

      #tree3 {background-image:url(../../img/default/menu_fondo.jpg);} 

      Note that the url to your image, if relative, should be relative to the file in which the CSS lives (browsers since Navigator 4.x have generally gotten this right).

      Regards,
      Eric

      ______________________________________________
      Eric Miraglia
      Yahoo! User Interface Library


      On Dec 27, 2006, at 2:54 PM, nat_farfan wrote:

      Hi Eric,

      I saw the images that you uploaded and is exactly what I need. But I
      think I'm doing something wrong. In the CSS I put the following code:

      #treeDiv1 {background-image:url(../../img/default/menu_fondo.jpg);}
      tree = new YAHOO.widget.TreeView("treeDiv1");

      I invoke the tree in demo.htm

      <html>
      <head>
      <title>Tree View</title>
      <link rel="stylesheet" type="text/css" href="css/multi/tree.css">
      <script type="text/javascript" src="build/yahoo.js" ></script>
      <script type="text/javascript" src="build/event.js"></script>
      <script type="text/javascript" src="build/treeview.js" ></script>
      <script type="text/javascript" src="build/jktreeview.js" ></script>

      <!-- Below is Style sheet for demos. Removed if desired -->
      <style type="text/css">
      body {font: normal 11px verdana, sans-serif; color: #333; line-
      height: 19px;}
      a { text-decoration: underline; color: #46546C; }
      a:hover { text-decoration: underline; color: #4d77c3; }
      #tree3 {width:750px;padding: 10px;float:left;}
      </style>

      </head>

      <body>

      <div id="tree3" class="treemenu"></div>

      <script type="text/javascript">

      var palmtree=new jktreeview("tree3")

      var branch1=palmtree.addItem("Coding Forums")
      palmtree.addItem("Prueba", branch1)

      var branch2=palmtree.addItem("PHP Reference")
      palmtree.addItem("Prueba2", branch2)

      var branch3=palmtree.addItem("Mozilla Dev Center")
      palmtree.addItem("Prueba3", branch3)

      var branch4=palmtree.addItem("CSS Drive")
      palmtree.addItem("Lista de Tareas", branch4)
      palmtree.addItem("Definiciones de Proceso", branch4)

      palmtree.addItem("Instancias de Proceso", branch4)

      palmtree.treetop.draw();

      </script>

      </body>
      </html>


      Do you have any idea why I couldn't see the background behind the
      tree?

      Thanks again for your help.
      Regards.

      --- In ydn-javascript@yahoogroups.com, Eric Miraglia <miraglia@...>
      wrote:
      >
      > nat_farfan,
      >
      > Sorry the attachment didn't come through for you. I've uploaded
      it
      > here:
      >
      > http://yuiblog.com/sandbox/yui/v0121/images/tvbg.png
      >
      > Regards,
      > Eric
      >
      > ______________________________________________
      > Eric Miraglia
      > Yahoo! User Interface Library
      >
      > On Dec 26, 2006, at 3:22 PM, nat_farfan wrote:
      >
      > > Hi Eric,
      > >
      > > I can't see the images that you attached, can you send the
      images to
      > > my email: nat_farfan@... please.
      > >
      > > Thanks.
      > > Regards.
      > >
      > > --- In ydn-javascript@yahoogroups.com, Eric Miraglia <miraglia@>
      > > wrote:
      > > >
      > > > nat_farfan,
      > > >
      > > > For me, the background does show up behind the entire tree â€"
      > > > although the entire tree consists of nodes, so the background
      > > only
      > > > shows up behind nodes. I've attached a screenshot showing what
      I
      > > see
      > > > when I tile a Yahoo! logo behind a TreeView instance.
      > > >
      > > > What part of your TreeView instance is not showing a background
      > > image
      > > > using this technique?
      > > >
      > > > Regards,
      > > > Eric
      > > >
      > > > ______________________________________________
      > > > Eric Miraglia
      > > > Yahoo! User Interface Library
      > > >
      > > > 
      > > >
      > > > On Dec 26, 2006, at 9:53 AM, nat_farfan wrote:
      > > >
      > > > > Hello Eric,
      > > > >
      > > > > Sorry for not explain my question. I'll clarify the question.
      > > > > I expect to see the background image appearing behind the
      entire
      > > > > tree. It could be possible to do that?.
      > > > >
      > > > > But with the code that you provide me, I just see the
      background
      > > > > image appering behind the child nodes.
      > > > >
      > > > > Thanks for your help.
      > > > > Regards.
      > > > >
      > > > > --- In ydn-javascript@yahoogroups.com, Eric Miraglia
      <miraglia@>
      > > > > wrote:
      > > > > >
      > > > > > nat_farfan,
      > > > > >
      > > > > > I'm sorry; I believe I may be misunderstanding your
      question.
      > > > > >
      > > > > > Indeed, the child nodes are part of the tree (and
      therefor, in
      > > > > this
      > > > > > example, part of the element treediv1 â€" so I would
      expect to
      > > see
      > > > > the
      > > > > > background image appearing behind the child nodes and
      behind
      > > the
      > > > > > entire tree.
      > > > > >
      > > > > > Perhaps you could clarify exactly what effect you're
      trying to
      > > > > achieve?
      > > > > >
      > > > > > Regards,
      > > > > > Eric
      > > > > >
      > > > > >
      > > > > >
      > > > > > ______________________________________________
      > > > > > Eric Miraglia
      > > > > > Yahoo! User Interface Library
      > > > > >
      > > > > >
      > > > > >
      > > > > > On Dec 26, 2006, at 8:55 AM, nat_farfan wrote:
      > > > > >
      > > > > > > Hello Eric,
      > > > > > >
      > > > > > > I follow the example that your provide me and I put the
      code
      > > in
      > > > > the
      > > > > > > CSS, but it didn't work. It just appear the background
      image
      > > in
      > > > > the
      > > > > > > child nodes.
      > > > > > >
      > > > > > > Do you have any idea about this error?
      > > > > > >
      > > > > > > Thanks for your help.
      > > > > > >
      > > > > > > Regards.
      > > > > > >
      > > > > > > --- In ydn-javascript@yahoogroups.com, Eric Miraglia
      > > <miraglia@>
      > > > > > > wrote:
      > > > > > > >
      > > > > > > > nat_farfan,
      > > > > > > >
      > > > > > > > Unless your needs are more complex, you should be able
      to
      > > do
      > > > > this
      > > > > > > in
      > > > > > > > your CSS. For example:
      > > > > > > >
      > > > > > > > <style>
      > > > > > > > #treeDiv1 {background-image:url(/images/bg.gif);}
      > > > > > > > </style>
      > > > > > > >
      > > > > > > > <script>
      > > > > > > > tree = new YAHOO.widget.TreeView("treeDiv1");
      > > > > > > > </script>
      > > > > > > >
      > > > > > > > Regards,
      > > > > > > > Eric
      > > > > > > >
      > > > > > > >
      > > > > > > > ______________________________________________
      > > > > > > > Eric Miraglia
      > > > > > > > Yahoo! Presentation Platform Engineering
      > > > > > > >
      > > > > > > >
      > > > > > > >
      > > > > > > > On Dec 21, 2006, at 4:55 PM, nat_farfan wrote:
      > > > > > > >
      > > > > > > > > Hi Eric,
      > > > > > > > >
      > > > > > > > > I'am using Treeview Control. It could be possible to

    Your message has been successfully submitted and would be delivered to recipients shortly.