Categories
PHP Programming Web Design

PHP Shorthand If Notation or the Ternary Operator

Why should I care about PHP Shorthand If Notation or the Ternary Operator

Programming would be a bit useless without being able to evaluate conditions using if/end and switch statements. If/Else statements is obviously a great tool, but they aren’t optimal (or necessary) in all situations. And so I introduce you to … PHP Shorthand If Notation or the Ternary Operator.

Ternary operator takes the form “(condition) ? (true return value) : (false return value)” to shorten your if/else structures.

Categories
jQuery Programming Web Design

jQuery Scroll page to position of an element/div

When you’re working with a complex page that has a load of areas on-screen, making use of this jQuery Scroll page to position of an element/div function below to scroll to the location will enhance you’re user experience by saving them needing to scroll… take them straight to it!

Categories
JavaScript jQuery Programming

Get element with CSS class name or id with jQuery

Get element with CSS class name or id with jQuery, jQuery is extremley powerful and a time (and even life) saver, using jQuery, you can get elements with CSS class name and id easily without too much blood and tears!