-
-
<div> inside an <a>, how wrong is it, and what alternatives exist?
I just stumbled upon this. Apparently since HTML5 you can actually put block level elements inside <a> tags.
-
Javascript using fade on changing innerHTML
Good luck learning, if you have any questions you can send me a pm in dutch. Léon
-
-
Javascript using fade on changing innerHTML
Hello Jochemke, repeating block of code is usually bad practice. I would suggest to use an array with options and some loops. This way it will be easier later on to edit your code. To add the fading effect you could use a library like jQuery (checkout .fadeOut() and .fadeIn()). Just put lettre, bigtext and smalltext inside a container and fade its opacity. Here is some code to get you started... var elements = [ document.getElementById("lettre"), document.getElementById("bigtext"), document.getElementById("smalltext") ]; var textOptions = [ // The first element is used as an index for "elements". // For example 0 refers to elements[0], thus "lettre". [0, "D", "T", "G", "C"] ]; var styleOptions = [ [0, "color", "#966EA1", "#759DA0", "#976866", "#9CBA89"], [0, "left", "500px", "100px", "370px", "100px"] // Add as much properties as you like. ]; var teller = 0; var interval = setInterval(function(){ // $("container").fadeOut(); // Reset "teller" if needed. if(teller == (textOptions[0].length - 1) ) teller = 0; // Loop through "textOptions". for(var i = 0; i < textOptions.length; i++){ // Get the correct element from "elements". var currentElement = elements[textOptions[i][0]] // Change its innerHTML. currentElement.innerHTML = textOptions[i][teller + 1]; } // Loop through "styleOptions". for(var j = 0; j < styleOptions.length; j++){ var cs = styleOptions[j]; var currentElement = elements[cs[0]] // Change its style. currentElement.style[cs[1]] = cs[teller + 2]; } teller++; // $("container").fadeIn(); }, 2000); Léon
- Slimbox 2
-
-
-
Can someone identify this?
It is just a simple height animation. The element containing the links has a height of 0, when the link is clicked it animates to a bigger height. Léon
-
-
-
Regex help!
You could try to concatenate them, so they become one string: <?php preg_match_all('', $row['name'] . $row['secondname'], $matches); Notice the dot between the variables. Léon
-
Warning: Cannot modify header information - headers already sent by ...
Do you have any whitespace before the <? part ? Léon
-
-
Date Time Picker
HTML5 comes with a native date-picker. However it is not fully supported yet by all browsers. Léon
-
Warning: Cannot modify header information - headers already sent by ...
Hello Stallman3738, I can remember I had this same issue, if I remember it correctly it was caused by whitespace. } ?> <!-- Here is whitespace. --> <?php if (isset($_POST['password'])) The white space between your php code is handled as output. You could try this: <?php // Make sure there is no whitespace before your opening tag. @session_start(); $class="loginTextbox"; if ($_SESSION['url']!="/amlak/index.php") { header("location:index.php"); exit (); } // Code merged. if (isset($_POST['password'])) { require_once './views/database/systemComponent.php'; require_once './views/database/dbConnector.php'; $dbConnectorObject =new dbConnector(); $sentPassword = $_POST['password']; $select = "SELECT * FROM password"; $result = mysql_query($select)or die(mysql_error()); while($rows=mysql_fetch_array($result)) { $currentFirstPassword = $rows['password1']; $currentSecondPassword = $rows['password2']; } if(md5($sentPassword)==$currentFirstPassword) { $_SESSION['login']=true; header("location:add.php"); exit(); } else{ $class="failedloginTextbox"; } } ?> Hope it helps, Léon
-
Please help my to add a calculator to my website - pretty please!
No problem, good luck with your project ! Léon
-
Please help my to add a calculator to my website - pretty please!
What are you trying to achieve Jimmymustang ? Maybe you should make a new thread. Léon
-
-
Simple Syntax question
I hope that this does what you want: <?php $prefix = ""; $numberArray = ["zero", "one", "two", "three", "four", "five", "six", "seven"]; $someArray = array( 'label' => 'Select Home Score', 'desc' => 'Select home score', 'id' => $prefix . 'homescore-select', 'type' => 'select', 'options' => call_user_func(function(){ global $numberArray; $optionsArray = array(); // Loop through $numberArray. for($i = 0; $i < count($numberArray); $i++){ $optionsArray[$numberArray[$i]] = array( "label" => $i, "value" => $i ); } return $optionsArray; }) ); ?> If you want more options you can just extend $numberArray. Léon
-
Simple Syntax question
Hey Mantis, not 100% sure what you're trying to achieve, but by looking at your code I think this is what you are looking for: <?php $prefix = ""; $someArray = array( 'label' => 'Select Home Score', 'desc' => 'Select home score', 'id' => $prefix . 'homescore-select', 'type' => 'select', 'options' => call_user_func(function(){ $optionsArray = array(); for($i = 0; $i <= 20; $i++){ $optionsArray[] = array($i); } return $optionsArray; }) ); ?> This script simply sets "options" to an array, which contains 20 other arrays containing a number from 0 to 20. You also need a PHP version of 5.3 or higher I believe. Léon
-
Check if image field is empty
Glad it helped
-
-
How to include duplicate markup in every web page
If the content is the only thing that changes, you can do it the other way around: just have one page and make the content dynamic by fetching it from text files or a database. But probably the two answers above me are the ones you are looking for. Léon