Jump to content


Check out our Community Blogs

dbk

Member Since 25 Jul 2010
Offline Last Active Aug 06 2010 08:54 AM
-----

Posts I've Made

In Topic: How to control a loop?

06 August 2010 - 08:54 AM

Thanks for all the comments!

I know that there are some problems with webkit, but this little application I'm working on is only for use in chrome - and for my use only :)

In Topic: How to control a loop?

03 August 2010 - 10:08 AM

Hi InitVI

Thank you!

I made a little adjustment to this:

<script language="JavaScript">
Opacity = 0;
function fadein(){

    if(Opacity < 0.5)
    {
        Opacity += 0.02;
        document.getElementById("fadeDiv").style.webkitOpacity = Opacity;
        setTimeout("fadein()", 20);
    }
}



But.. Why do I have to declare the variable outside the function?? Shouldn't it be possible to declare the variable when the function i called like this:

<script language="JavaScript">
function fadein(Opacity){

    if(Opacity < 0.5)
    {
        Opacity += 0.02;
        document.getElementById("fadeDiv").style.webkitOpacity = Opacity;
        setTimeout("fadein(Opacity)", 20)
    }
} 
</script>
</head>
<body onload="fadein(0)">

Why can't I make this work!! It would be easier to call the functions if they are made placed as external files!

In Topic: Help with simple function!

29 July 2010 - 11:36 AM

Only one thing to say to you InitVI:

Your the man! :thumbup:

Thanks a lot!

In Topic: Help with simple function!

28 July 2010 - 12:34 PM

Hi again

I made a little add on to the function, I want to set one row as selected when the page loads, which gets the " id='preset' " and I use the " document.getElementById('preset') " to change if a row is clicked.
It works fine in Chrome and Firefox but not in IE8 !!!! Anyone has a idea why???

var clicked_row = true;

function control_row(tr) {
    if(tr.className == 'row_content' || tr.Id == 'preset'){
		document.getElementById('preset').setAttribute('class', 'row_content'); //Change if one row is preset
                tr.className='row_content_click';
                clicked_row.className='row_content';
    }
    clicked_row=tr;
}
</script>
    <div id='preset' class='row_content_click' onclick="control_row(this);">Hallo</div>
    <div class='row_content' onclick="control_row(this);">Bob</div>
    <div class='row_content' onclick="control_row(this);">Your the man!!!</div>


In Topic: Help with simple function!

28 July 2010 - 07:25 AM

Very fine description, now I understand :) - Thanks a lot!!!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download