Results 1 to 3 of 3

Thread: Adding an image to a Zimlet JS file...

  1. #1
    Join Date
    Sep 2006
    Location
    Illinois
    Posts
    374
    Rep Power
    9

    Default Adding an image to a Zimlet JS file...

    I have an more_info.png file stored in a Zimlet. How do I have that image appear in a Zimlet dialog using JS?

    Code:
    var div = document.createElement("div");
    div.innerHTML = '<img src="more_info.png">'
    All that appears in the dialog is a broken image item.

    Matt

  2. #2
    Join Date
    Jul 2006
    Location
    Pisa
    Posts
    135
    Rep Power
    9

    Default

    yu can use css, for a zimlet you can specify a css file you can put the following text

    .img_logo{
    background: url(myimg.gif) no-repeat;
    width: 135px;
    height: 45px;
    }

    the in javascript use: <div class='img_logo'/>

    the myimg.gif must be in the zimlet's folder.

  3. #3
    Join Date
    Mar 2008
    Location
    Stanford, CA
    Posts
    15
    Rep Power
    7

    Default

    You can also define it as a resource in your Zimlet xml file:

    Code:
        <resource>more_info.png</resource>
    Then use getResource to get the URL for it:

    Code:
    div.innerHTML = "<img src='" + this.getResource('more_info.png') + "' border='0'/>";
    As with the CSS technique, you need to put the image in the zimlet directory.

Similar Threads

  1. Replies: 21
    Last Post: 02-04-2010, 10:06 AM
  2. Zimbra OSS 4.5.11 Re-install
    By newmember in forum Installation
    Replies: 0
    Last Post: 09-09-2008, 11:26 PM
  3. Adding openSUSE 10.3 to file get_plat_tag.sh
    By bigmudcake in forum Developers
    Replies: 3
    Last Post: 10-16-2007, 09:25 PM
  4. Zimbra Install Problem - getDirectContext
    By bsimzer in forum Installation
    Replies: 27
    Last Post: 07-19-2007, 11:12 AM
  5. Is it started or not
    By kwelipatton in forum Installation
    Replies: 10
    Last Post: 03-28-2006, 11:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •