Click here to Skip to main content
15,887,376 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: How can i refresh status bar information... Pin
Olli Ikonen30-Apr-11 1:37
Olli Ikonen30-Apr-11 1:37 
GeneralRe: How can i refresh status bar information... Pin
Luc Pattyn30-Apr-11 2:26
sitebuilderLuc Pattyn30-Apr-11 2:26 
GeneralRe: How can i refresh status bar information... Pin
DaveAuld30-Apr-11 4:05
professionalDaveAuld30-Apr-11 4:05 
GeneralRe: How can i refresh status bar information... Pin
Luc Pattyn30-Apr-11 4:48
sitebuilderLuc Pattyn30-Apr-11 4:48 
GeneralRe: How can i refresh status bar information... Pin
DaveAuld30-Apr-11 4:51
professionalDaveAuld30-Apr-11 4:51 
GeneralRe: How can i refresh status bar information... Pin
DaveAuld30-Apr-11 6:35
professionalDaveAuld30-Apr-11 6:35 
GeneralRe: How can i refresh status bar information... Pin
DaveAuld30-Apr-11 5:32
professionalDaveAuld30-Apr-11 5:32 
QuestionWhat in a world i'm doing wrong... Pin
Olli Ikonen30-Apr-11 6:47
Olli Ikonen30-Apr-11 6:47 
'cause it won't work...sorry for bothering again...

var autoUpdate         = false;
var theString          = "";

///////////////////
// startUpdate()
///////////////////
function startUpdate()
{   
    autoUpdate = true;
    setTimeout(function () { updateStatus(); }, 10);
    window.status = "Start updating...";
}

////////////////////
// updateStatus()
////////////////////
function updateStatus()
{
    window.status = theString;
   
    if(autoUpdate)
    {
        setTimeout(function () { updateStatus(); }, 10);
    }
    else
    {
        window.status += " > Updated...";
    }
}

////////////////
// show items
////////////////
function fillItemContent(category)
{
   
    var frameTop             = 20;                        // top edge of surrounding frame
    var frameLeft         = 0;                        // left edge of surrounding frame
    var frameWidth         = 0;   
    var frameHeight     = 0;   
   
    var width                 = 256;                    // item window width
    var height                 = 302;                    // item window height
    var borderWidth     = 2;                        // item window border width   
    var horGap                 = 8;                        // horizontal gap between item windows
    var verGap                 = 8;                        // vartical gap between item windows
    var colCount             = 0;                        // amount of windows horizontally in client area
    var rowCount             = 0;                        // amount of windows horizontally in client area
    var colCnt                 = -1;                        // amount of windows vertically in client area
    var rowCnt               = 0;
    var art                     = 1;
    var itemCount         = 0;                        
           
    var outerContent = document.getElementById('sisalto2');
   
    // count items in -this- gategory
    for(i = 0; i < items.length; i++)
    {
        if(items[i]._category == category)
        {
            ++itemCount;   
        }
    }

    // make the frame surrounding items and center it
   
    // ho many windows will fit horizontally in client area
    colCount = Math.floor(document.body.clientWidth / (width + horGap));
    // calculate the left edgeposition
    frameWidth = colCount * (width + 2 * borderWidth + horGap) + 2 + 2 * borderWidth;
    frameLeft = (document.body.clientWidth - frameWidth) / 2;
    // how many windows fit vertically in client area
    rowCount = Math.ceil(itemCount / colCount);       
    frameHeight = rowCount * (height + 2 * borderWidth + verGap) + 2 + 2 * borderWidth; 
   
    theString = "";
    startUpdate();   
   
    // start constructing...
    contentString = '<div id="container_' + category + '" style="width: ' + frameWidth + 'px;'
                                    + ' height: ' + frameHeight + 'px; padding-top: 0; margin-top: 20px; margin-bottom: 38px; margin-left: '
                                    + frameLeft + 'px; border: solid thin #AAA;">'; 
                                   
    // insert items   
    for(i = 0; i < items.length; i++ )
    {
        if(items[i]._category == category)
        {
             ++colCnt;
            theString += ".";
            sleep(199);
            contentString  += (    // surrounding frame
                                                     ' <div id="art_' + i +'" style="position:absolute; border:thin solid #000;'
                                                    + ' background-image: url(img/tuote_tausta.gif); width:' + width +    'px; height:'
                                                    +  height + 'px; margin:' + (rowCnt * (height + verGap +  2) + verGap) + 'px auto ' + 'auto '
                                                    +  (colCnt * (width + horGap + 2 * borderWidth) + horGap) + 'px;">'
                                                    // header
                                                    + ' <div id="tuoteotsikko_' + i + '" style="text-align:center; color:#b5672d; height:18px; '
                                                    + ' border-bottom:thin solid #000;'
                                                    + ' padding:2px; background-color:#ff9b44;"><strong>'
                                                    +   items[i]._shortname  + '</strong></div>'
                                                    // item thumbnail holder
                                                    + ' <div id="tuote_kehys_' + i + '" style="border:;'
                                                    + ' color:#000; text-align: center; background: none; width:128px; height:96px; '
                                                    + ' margin:10px auto auto 10px;">'
                                                    // item thumbnail
                                                    + ' <img id="tuotekuva_' + i + '" height="96px" style="background-color: #666; cursor: pointer;'
                                                    + ' moz-opacity:1;filter:alpha(opacity=100);"'
                                                    + ' onmouseout="this.style.MozOpacity=1;this.filters.alpha.opacity=100"'
                                                    + ' onmouseover="this.style.MozOpacity=0.5;this.filters.alpha.opacity=50"'
                                                    + ' onclick="showModal(event)"'
                                                    + ' src="' + itemImages[i].src + '" /></div>'
                                                    // item price and short description
                                                    + ' <div id="tuotetiedot_' + i + '"  style="position:absolute; border:none; color:#000;'
                                                    + ' text-align:right; padding:0;'
                                                    + ' height:96px; width:96px; top: 18px;  overflow: hidden;'
                                                    + ' margin:13px auto auto 146px;">Hinta:<br /><strong>' + items[i]._price + '</strong><br />'
                                                    +   items[i]._desc2 + '</strong></div>'
                                                    // main description of item
                                                    + ' <div id="tuotekuvaus_' + i + '" style="text-align:left; position:absolute; border:thin solid #AFAF61;'
                                                    + ' color:#000; background-image: url(img/tuote_taustaRev.gif);'
                                                    + ' text-indent: 0px; width:232px; height:148px; margin:10px auto 10px 10px;">' + items[i]._desc1 + '</div>'                                                   
                                                    + ' </div>');
                 
            if(colCnt >= (colCount - 1))
            {
                colCnt = -1;
                ++rowCnt;
            }
        }
    }
    // construct tail
    contentString += '</div>';
    autoUpdate = false;
    outerContent.innerHTML = contentString;
}
</code>


Olli.
AnswerRe: What in a world i'm doing wrong... Pin
Luc Pattyn30-Apr-11 6:52
sitebuilderLuc Pattyn30-Apr-11 6:52 
NewsSorry Pin
Olli Ikonen30-Apr-11 10:01
Olli Ikonen30-Apr-11 10:01 
GeneralRe: What in a world i'm doing wrong... Pin
DaveAuld30-Apr-11 19:58
professionalDaveAuld30-Apr-11 19:58 
AnswerRe: What in a world i'm doing wrong... Pin
Luc Pattyn30-Apr-11 21:27
sitebuilderLuc Pattyn30-Apr-11 21:27 
AnswerDuplicate - Your question also in Q/A section Pin
thatraja30-Apr-11 7:04
professionalthatraja30-Apr-11 7:04 
GeneralRe: How can i refresh status bar information... Pin
thatraja30-Apr-11 8:22
professionalthatraja30-Apr-11 8:22 
NewsSorry Pin
Olli Ikonen30-Apr-11 10:01
Olli Ikonen30-Apr-11 10:01 
Question[RESOLVED] innerHTML messed up Pin
CodingLover27-Apr-11 18:58
CodingLover27-Apr-11 18:58 
AnswerRe: innerHTML messed up Pin
AspDotNetDev27-Apr-11 19:43
protectorAspDotNetDev27-Apr-11 19:43 
GeneralRe: innerHTML messed up Pin
CodingLover27-Apr-11 21:09
CodingLover27-Apr-11 21:09 
AnswerRe: innerHTML messed up Pin
Gerben Jongerius27-Apr-11 20:53
Gerben Jongerius27-Apr-11 20:53 
GeneralRe: innerHTML messed up Pin
CodingLover27-Apr-11 21:11
CodingLover27-Apr-11 21:11 
GeneralRe: innerHTML messed up Pin
Gerben Jongerius27-Apr-11 21:47
Gerben Jongerius27-Apr-11 21:47 
GeneralRe: innerHTML messed up Pin
CodingLover27-Apr-11 23:11
CodingLover27-Apr-11 23:11 
QuestionDynamics CRM 2011 - Cutomizing datetime picker in CRM Form [SOLVED] Pin
phil.o27-Apr-11 4:55
professionalphil.o27-Apr-11 4:55 
AnswerRe: Dynamics CRM 2011 - Cutomizing datetime picker in CRM Form Pin
Graham Breach27-Apr-11 12:06
Graham Breach27-Apr-11 12:06 
GeneralRe: Dynamics CRM 2011 - Cutomizing datetime picker in CRM Form Pin
phil.o27-Apr-11 20:39
professionalphil.o27-Apr-11 20:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.