Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 11 results for
consolelog
- Page 1
Linux Audio Streaming (live!) using Ices and Icecast
Hardware and Software
Linux and Unix
19 Years Ago
by kc0arf
… ignored if this is set to 1 --> <
consolelog
>0</
consolelog
> <!-- optional filename to write process id…
Else statement is getting run even if the if statement is true
Programming
Web Development
9 Years Ago
by Bensirpent07
… it just runs the first line again. I even used .
consoleLog
() to make sure that "down = false". So it…
ajax post is empty
Programming
Web Development
4 Years Ago
by Eugene_15
…; </div> ![column2.png](/attachments/large/4/f9d2323b474ae17712c10c62d3790891.png) ![
consolelog
.png](/attachments/large/4/1c4a6c5ec511be19a30c5b483b8a6bde.png) ![overlaypic.png](/attachments/large…
Re: Else statement is getting run even if the if statement is true
Programming
Web Development
9 Years Ago
by stbuchok
you are assigning down to be true in your if statement if(down){ //do stuff if down is true } else{ //do stuff if down false } or if(down == true){ //do stuff if down is true } else{ //do stuff if down false }
Re: Else statement is getting run even if the if statement is true
Programming
Web Development
9 Years Ago
by Bensirpent07
Alright so I changed it to this: if(down == true){ $(head).animate({paddingTop:'287px'}, {duration: 0, queue: false}); down = false; } else{ $(head).animate({paddingTop:'125px'}, {duration: 0, queue: false}); down = true; } But now it ONLY runs the else statement, it won't run the if statement. There is no …
Re: Else statement is getting run even if the if statement is true
Programming
Web Development
8 Years Ago
by stbuchok
That just means that down is always false, you have to find out why. Try stepping through the code with a dev tool for your browser. Also, I'd change it to the following: var topPadding = '125px'; if(down) topPadding = '287px'; $(head).animate({paddingTop: topPadding}, {duration: 0, queue: false}); down = !…
Re: Else statement is getting run even if the if statement is true
Programming
Web Development
8 Years Ago
by Bensirpent07
Ok so I tried to track down the problem a little bit by trying to add some console.log()'s and this is what I used as the code (by the way as soon as I figure this problem out I'm going to take your advice and use the code you suggested, I just want to make sure I don't confuse myself... or anyone else). menu.slideToggle(function(){ if(…
Re: Else statement is getting run even if the if statement is true
Programming
Web Development
8 Years Ago
by stbuchok
Do you have any other click events on the page? Put an alert or console.log statement just before menu.slideToggle. I bet your click event is firing twice.
Re: Else statement is getting run even if the if statement is true
Programming
Web Development
8 Years Ago
by Bensirpent07
Aha! I've figured out what's going. So it's not that there are two click events, because I made sure right above menu.slideToggle using an alert. **But**, I put a console.log('yes') on the inside of the menu.slideToggle like this: menu.slideToggle(function(){ console.log('yes') if(down){ $(head).animate({paddingTop:'…
Re: Else statement is getting run even if the if statement is true
Programming
Web Development
8 Years Ago
by Bensirpent07
Well I never exactly figured out why it would fire twice, **But,** I changed up the code and used this, and now it works. I guess that's what I get for trying to cut corneres haha. $(function() { var pull = $('#pull'); menu = $('div#nav ul'); menuHeight = menu.height(); head = $('div…
Re: ajax post is empty
Programming
Web Development
4 Years Ago
by grant.baker
It looks like you're trying to mix JS with PHP here. You need to add some code to the ajax success function to do something with the result. From the code you posted, I'm not sure you're actually getting the result you want. But if you are, this code should help you out. In the index.php file, add an id to the div that contains `<?php echo $…
Search
Search
Forum Categories
Hardware/Software
Programming
Digital Media
Community Center
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Meet People
Forums
Top Members
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2024 DaniWeb® LLC