if-else-statement

Unordered List size scroll question

I have an UL with a lot of List items in it, I made a custom scroll to animate the DIV box so that you can see all the list items, i was the make an if else statement that says if your at the top you cant scroll past it and if you dont need to scroll to see anymore LI you cant go down any further. ...

creating IF ELSE statements

I am looking to create an IF ELSE statement that says IF You reach the end of the UL LI, unbind click function from scroll button, ELSE bind click funtion $(document).ready(function () { $('#down').click(function () { $(".project_thumbs").stop().animate({ "top": "-=510px" }); }); $('#up').click(...

How to create a animate to specific LI in an UL?

I am using Jquery .animate to scroll a UL up and down so that you can see all the elements, how would i make IF ELSE statement that said. IF the FIRST LI item in the UL is at the top, dont scroll anymore, and IF the last item is at the bottom of the visible portion of the screen dont scroll any more down, else scroll 510 px. Right now ...

PHP if/else switch not working

Goal: Trying to get a rollover button state to remain "ON" when URL equals "enhanced.php". Problem: Button state does not remain "on" when URL equals "enhanced.php". (Button acts correctly as a rollover) sidemenu.php sidemenu.php is used as a PHP include on all pages (I don't know if that makes a difference <?php $script = $_SERV...

INVALID SYNTAX ERROR for 'else' statement in python

I am trying to write a quicksort program in python, however I'm getting an invalid syntax error at else statement in the second last line below: import random n=int(raw_input("Enter the size of the list: ")) # size of the list intlist = [0]*n for num in range(n): intlist[num]=random.randint(0,10*n) pivot=random.choice(intlist) lis...

AS3: Only allow a certain number of a certain type of object into an Array

I want to find a way to only allow certain objects into an array that have a certain word in thier class name. Or at least find the optimal way of doing something like this. Heres the details. I have an Array that stores all the objects dropped into a cart. function addProductToArray (e:MouseEvent):void{ currMC = (e.target as MovieClip...

Need help refactoring this Javascript if/else statement

Here's my current if/else statement: var current_class = $(this).closest("article").attr("class") if (current_class == 'opened') { $(this).closest("article").removeClass('opened'); $(this).closest("article").addClass('closed'); } else { $(this).closest("article").removeClass('closed'); $(this).closest("article").addClass('opene...

Smalltalk Variadic functions

Does Smalltalk(especially Squeak/Pharo) have some form of variadic functions? I was just reading about the power of designing your own control statments in smalltalk and while I'm a big fan of ifTrue: ifFalse: I was having a hard time coming up with a good way to implement arbitrary if,if else, if else,...,else statements thinking how u...

problem with if/else and switch statements in android

the following code is to handle ACTION_DOWN and ACTION_UP events for a button named clash. the idea is that once if/else determines that the onTouch event was caused by clash and the switch statement then determines what to do based on the action. i don't know if the problem is that the switch statements are not returning true and that...

if/else format within while loop

while(true) { cout << "Name: "; getline(cin, Name); if(Name == "Stop") break; cout << "Additional Name - Y/N: "; getline(cin, additional); if (additional == "Y") cout << "Additional Name: "; getline(cin, Name2); else cout << "Location: "; getline(cin, Location); if(Location == "Stop") break; } chi...

accordion if/else logic

Hi. I'm guessing my if/else logic is skewed. Basically I have an accordion structure where, on page load, the first accordion pane is half-revealed to a height of 150px. Then when the user clicks on the accordion header it fully opens to a height of 320px. On the next click it should close and act normally like the other accordion elemen...