Click here to Skip to main content
15,914,395 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: Check all doesn't work with one row in javascript Pin
enhzflep30-Oct-09 2:28
enhzflep30-Oct-09 2:28 
QuestionEnabling Default Document Pin
www.Developerof.NET28-Oct-09 9:17
www.Developerof.NET28-Oct-09 9:17 
AnswerRe: Enabling Default Document Pin
Marc Firth28-Oct-09 23:09
Marc Firth28-Oct-09 23:09 
QuestionCrystal Reports Export to PDF not working Pin
Tamimi - Code28-Oct-09 8:07
Tamimi - Code28-Oct-09 8:07 
QuestionRe: Crystal Reports Export to PDF not working Pin
Jörgen Andersson29-Oct-09 1:49
professionalJörgen Andersson29-Oct-09 1:49 
AnswerRe: Crystal Reports Export to PDF not working Pin
Tamimi - Code30-Oct-09 0:49
Tamimi - Code30-Oct-09 0:49 
GeneralRe: Crystal Reports Export to PDF not working Pin
Jörgen Andersson30-Oct-09 1:09
professionalJörgen Andersson30-Oct-09 1:09 
GeneralRe: Crystal Reports Export to PDF not working Pin
Tamimi - Code30-Oct-09 3:57
Tamimi - Code30-Oct-09 3:57 
GeneralRe: Crystal Reports Export to PDF not working Pin
N.Surendra Prasad12-Nov-09 0:34
N.Surendra Prasad12-Nov-09 0:34 
QuestionASP(Tinymceeditor) Pin
rajiv_kadam28-Oct-09 1:03
rajiv_kadam28-Oct-09 1:03 
AnswerRe: ASP(Tinymceeditor) Pin
Ashfield29-Oct-09 2:57
Ashfield29-Oct-09 2:57 
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 

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.