Click here to Skip to main content
15,886,026 members
Home / Discussions / Web Development
   

Web Development

 
QuestionOnly 1st page of wikipedia gets printed Pin
Sharadb.adobe27-Oct-09 23:48
Sharadb.adobe27-Oct-09 23:48 
QuestionWhat is the common Calendar synchronization principle? Pin
Pradeep kumar.V27-Oct-09 22:15
Pradeep kumar.V27-Oct-09 22:15 
QuestionProblem in accessing files from one virtual directory to second virtual directory on GoDaddy Pin
chirag_chauhan27-Oct-09 15:25
chirag_chauhan27-Oct-09 15:25 
AnswerRe: Problem in accessing files from one virtual directory to second virtual directory on GoDaddy Pin
Richard MacCutchan27-Oct-09 22:38
mveRichard MacCutchan27-Oct-09 22:38 
GeneralRe: Problem in accessing files from one virtual directory to second virtual directory on GoDaddy Pin
Christian Graus29-Oct-09 0:27
protectorChristian Graus29-Oct-09 0:27 
QuestionHow identify cookies on your computer, that use current web-site ? Pin
progman27-Oct-09 12:36
progman27-Oct-09 12:36 
AnswerRe: How identify cookies on your computer, that use current web-site ? Pin
Oakman3-Nov-09 12:16
Oakman3-Nov-09 12:16 
Questionjavascript setTimeout and return logic Pin
compninja2527-Oct-09 6:19
compninja2527-Oct-09 6:19 
Hi guys!

I can't figure out what the heck I'm doing wrong. I'm making a (hoping to at least) simple function that will take a white border and fade it to black on a mouseOver. Here's what I have so far:

<script type="text/javascript">
    function animation(object, direction, number) {
        if (!number) {
            if (direction == "out") number = 255;
            if (direction == "in") number = 0;
        }

         var color = "rgb(" + number + "," + number + "," + number + ")";
         object.style.borderColor = color;


         if (direction == "out") {
             if (number == 0) return;

             var newNumber = number - 1;
             window.setTimeout(animation(object, direction, newNumber), 500);
         }

         if (direction == "in") {
             if (number == 255) return ;

             var newNumber = number + 1;
             window.setTimeout(animation(object, direction, newNumber), 500);
         }
     }
</script>


Now, what happens (when I use the debugger in visual studio 2008), the function executes correctly until the number variable gets to 255. At 255, the system does see the if (number == 255) return; part and appears to execute it. What happens after that when I hit F11 to continue stepping into the code, it jumps down to the window.setTimeout line again and tell's me there's an invalid argument. What's really weird, is that the number variable has now gone back to 254! I've even tried changing the if statement to stop at 250 and other various numbers, but it still seems to subtract a number and then give me the failure insted of stopping execution. Looking at other setTimeout examples, I also tried different syntax including wrapping the function in quotes, but this is the only way I've been able to get it to actually call the function. Wrapping it in quotes seems to just jump to the next line and return. I'm still fairly new to javascript, so I wouldn't doubt that there's something wrong with the flow of my logic, but I'm to the point where I feel like I'm not getting anywhere. Hopefully another set of eyes might see what's not obvious to me.

Thanks!

Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.

AnswerRe: javascript setTimeout and return logic Pin
Covean27-Oct-09 6:30
Covean27-Oct-09 6:30 
AnswerRe: javascript setTimeout and return logic Pin
Not Active27-Oct-09 6:45
mentorNot Active27-Oct-09 6:45 
GeneralRe: javascript setTimeout and return logic Pin
compninja2527-Oct-09 8:03
compninja2527-Oct-09 8:03 
QuestionWhich HTML element under mouse cursor in WebBrowser control? PinPopular
tanton-gaston27-Oct-09 4:01
tanton-gaston27-Oct-09 4:01 
Questiongoogle-calendar like application in jsp-ajax or jsp-javascript Pin
sanuji26-Oct-09 20:55
sanuji26-Oct-09 20:55 
AnswerRe: google-calendar like application in jsp-ajax or jsp-javascript Pin
Ashfield26-Oct-09 22:24
Ashfield26-Oct-09 22:24 
GeneralRe: google-calendar like application in jsp-ajax or jsp-javascript Pin
sanuji26-Oct-09 22:51
sanuji26-Oct-09 22:51 
GeneralRe: google-calendar like application in jsp-ajax or jsp-javascript Pin
Richard MacCutchan26-Oct-09 23:25
mveRichard MacCutchan26-Oct-09 23:25 
GeneralRe: google-calendar like application in jsp-ajax or jsp-javascript Pin
Ashfield27-Oct-09 2:15
Ashfield27-Oct-09 2:15 
GeneralRe: google-calendar like application in jsp-ajax or jsp-javascript Pin
Richard MacCutchan27-Oct-09 3:51
mveRichard MacCutchan27-Oct-09 3:51 
GeneralRe: google-calendar like application in jsp-ajax or jsp-javascript Pin
Ashfield27-Oct-09 5:29
Ashfield27-Oct-09 5:29 
GeneralRe: google-calendar like application in jsp-ajax or jsp-javascript Pin
Oakman3-Nov-09 12:15
Oakman3-Nov-09 12:15 
QuestionQuestion about Redirect - HTML / ASP (trad.) Pin
tiwal26-Oct-09 5:21
tiwal26-Oct-09 5:21 
AnswerRe: Question about Redirect - HTML / ASP (trad.) Pin
Not Active26-Oct-09 6:34
mentorNot Active26-Oct-09 6:34 
GeneralRe: Question about Redirect - HTML / ASP (trad.) Pin
tiwal26-Oct-09 6:47
tiwal26-Oct-09 6:47 
GeneralRe: Question about Redirect - HTML / ASP (trad.) Pin
Not Active26-Oct-09 6:56
mentorNot Active26-Oct-09 6:56 
GeneralRe: Question about Redirect - HTML / ASP (trad.) Pin
tiwal26-Oct-09 7:39
tiwal26-Oct-09 7: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.