Looking for ..........

Discussion in 'Javascript' started by Willard Reese, Feb 11, 2004.

  1. I need a javascript that will show something like a thermometer where
    the thermometer fluid can be periodically set to a certain level.
    Something like they use to display progress in fund raising efforts.
    (like Community Chest drives).
    Can anyone help?

    Hap Reese
    Willard Reese, Feb 11, 2004
    #1
    1. Advertising

  2. Willard Reese

    Fabian Guest

    areese@no-spam bestnetpc.com (Willard Reese) hu kiteb:

    > I need a javascript that will show something like a thermometer where
    > the thermometer fluid can be periodically set to a certain level.
    > Something like they use to display progress in fund raising efforts.
    > (like Community Chest drives).
    > Can anyone help?


    I'd implement this as a background gif with the basic thermometer shape,
    and another gif as a red line. I'd then manipulate the height attribute
    of teh second to stretch it to the desired height. I've no idea if
    anything like this has been made before.


    --
    --
    Fabian
    This post is not associated in any way with forum4designers dot com.
    Permission is specifically denied for that website to archive this post
    or display it in any way.
    Fabian, Feb 11, 2004
    #2
    1. Advertising

  3. Willard Reese

    McKirahan Guest

    <areese@no-spam bestnetpc.com (Willard Reese)> wrote in message
    news:...
    > I need a javascript that will show something like a thermometer where
    > the thermometer fluid can be periodically set to a certain level.
    > Something like they use to display progress in fund raising efforts.
    > (like Community Chest drives).
    > Can anyone help?
    >
    > Hap Reese



    You could just have several versions of a thermometer image each
    representing a different level.

    Here's an image that could serve as a base:

    http://www.uwev.org/images/thermometer.gif
    McKirahan, Feb 11, 2004
    #3
  4. Fabian wrote:

    > areese@no-spam bestnetpc.com (Willard Reese) hu kiteb:
    >
    >
    >>I need a javascript that will show something like a thermometer where
    >>the thermometer fluid can be periodically set to a certain level.
    >>Something like they use to display progress in fund raising efforts.
    >>(like Community Chest drives).
    >>Can anyone help?

    >
    >
    > I'd implement this as a background gif with the basic thermometer shape,
    > and another gif as a red line. I'd then manipulate the height attribute
    > of teh second to stretch it to the desired height. I've no idea if
    > anything like this has been made before.


    If you don't want to use graphics, you can experiment with a table cell
    changing the border width from one side.

    --
    Bas Cost Budde
    http://www.heuveltop.org/BasCB
    but the domain is nl
    Bas Cost Budde, Feb 12, 2004
    #4
  5. Thank for the suggestions and for the great thermometer. I'll work on
    this. Good start. thanks all.
    Willard


    On Wed, 11 Feb 2004 23:48:40, "McKirahan" <> wrote:

    > <areese@no-spam bestnetpc.com (Willard Reese)> wrote in message
    > news:...
    > > I need a javascript that will show something like a thermometer where
    > > the thermometer fluid can be periodically set to a certain level.
    > > Something like they use to display progress in fund raising efforts.
    > > (like Community Chest drives).
    > > Can anyone help?
    > >
    > > Hap Reese

    >
    >
    > You could just have several versions of a thermometer image each
    > representing a different level.
    >
    > Here's an image that could serve as a base:
    >
    > http://www.uwev.org/images/thermometer.gif
    >
    >


    Hap Reese
    Willard Reese, Feb 12, 2004
    #5
  6. Willard Reese wrote:

    > I need a javascript that will show something like a thermometer where
    > the thermometer fluid can be periodically set to a certain level.


    Using images can be good to provide some background appearance, and you
    can then use javascript to have the thermometer level adjusted, changing
    height of simple HTML div elements.


    <style type="text/css">
    div#container{
    position:absolute;bottom:10%;right:10%;
    width:20px;height:200px;
    background:#c00;
    border:ridge 1px #000;
    overflow:hidden;
    }
    div#container div{
    background:#eee;
    line-height:0;
    height:100%;
    }
    </style>

    <script type="text/javascript">
    onload=function(evt){
    this["thermometer"]=function(){
    var $th=null;

    function getm(dir){
    var
    ptr_c=document.getElementById("container"),
    ptr_t=ptr_c.getElementsByTagName("div")[0];
    dir*=-1;
    return function(m){
    m=ptr_t.offsetHeight+dir*m;
    if(0<m&&m<ptr_c.offsetHeight)
    ptr_t.style.height=m+"px";
    }
    }

    if(document.getElementById&&
    document.getElementsByTagName){
    $th={
    up:getm(+1),
    down:getm(-1)
    };
    }

    return $th;
    }();

    if(this["thermometer"]){
    setTimeout(
    function(){
    this["thermometer"]
    [Math.random()<0.6?"up":"down"](Math.random()*5|0);
    setTimeout(arguments.callee,40);
    },
    50
    );
    }
    }
    </script>

    <div id="container"><div>&nbsp;</div></div>
    Yann-Erwan Perio, Feb 12, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ilker ORAN

    im looking for job?

    ilker ORAN, Nov 27, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    494
    Robby
    Nov 29, 2004
  2. Antonio D'Ottavio

    Looking for free dotnet forum

    Antonio D'Ottavio, Sep 16, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    2,984
    Galin Iliev
    Sep 19, 2005
  3. Andrew Paule

    Re: looking for systemC cores

    Andrew Paule, Jul 20, 2003, in forum: VHDL
    Replies:
    0
    Views:
    1,048
    Andrew Paule
    Jul 20, 2003
  4. scd
    Replies:
    0
    Views:
    661
  5. Mark
    Replies:
    9
    Views:
    165
    Patrick Hurley
    Mar 10, 2006
Loading...

Share This Page