Reputation Activity
-
Leonvv got a reaction from Willows in toggle div style problem.Do you have a link ?
That makes helping a lot easier.
Léon
-
Leonvv got a reaction from Nillervision in Javascript using fade on changing innerHTMLHello 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
-
Leonvv got a reaction from Mr Ben in 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
-
Leonvv got a reaction from Precise Estimating Ltd in 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
-
Leonvv reacted to sash_oo7 in Help with Php Signup Form!?see here
-
Leonvv got a reaction from Lee_K in 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
-
Leonvv reacted to mteam in CSS effect multiple classesWhy not
.bar1, .bar2, .bar3{height:10px} or add an extra class
<ul> <li class="bar1 barht">Your stuff</li> <li class="bar2 barht">Your stuff</li> <li class="bar3 barht">Your stuff</li> <li class="bar4 barht">Your stuff</li> <ul>
.barht{height:10px}
-
Leonvv got a reaction from mantis in Simple Syntax questionI 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
-
Leonvv got a reaction from Row in Check if image field is emptyHey Row !
Not sure if you're still struggling with this problem,
but I got it working using the following code:
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Upload Test</title> </head> <body> <?php if(isset($_FILES["upload"]) && !empty($_FILES["upload"])){ $imageCount = count($_FILES["upload"]["name"]); if($imageCount > 3){ // More than 4 images uploaded. echo "You can only upload 4 images."; } else if($imageCount == 1 && empty($_FILES["upload"]["name"][0])){ // No image uploaded. echo "No image selected."; } else{ $allowedExt = array("jpg", "jpeg", "png", "gif"); for($i = 0; $i < $imageCount; $i++){ $fileName = $_FILES["upload"]["name"][$i]; $fileSize = $_FILES["upload"]["size"][$i]; $extensionArray = explode('.', $fileName); if( !in_array(end($extensionArray), $allowedExt) ){ // Illegal extension. echo "Only jpg, jpeg, png, and gif are allowed."; break; } else if($fileSize > 2097152){ // File is too big. echo "Maximum allowed size is 2MB."; break; } else{ // Process the image. if(($i + 1) == $imageCount){ // Success message when the last image is processed. echo "Upload successful !"; } } } } } ?> <form action="" enctype="multipart/form-data" method="post"> <input type="file" name="upload[]" multiple="multiple" /> <br /> <input type="submit" value="Upload" /> </form> </body> </html>
Note the name of the input tag.
Because of some reason I haven't figured out yet,
it is necessary to write it in an "array notation" when using the "multiple" attribute otherwise only the last image is processed.
Another ugly thing is that the $imageCount will be 1 if you don't upload any image.
This is because $_FILES["upload"]["name"] will contain an empty array by default, for another mysterious reason...
Hope it helps en succes !
Léon
Ps, multiple file upload is not fully supported yet.
-
Leonvv got a reaction from Lyndsey in Check if image field is emptyHey Row !
Not sure if you're still struggling with this problem,
but I got it working using the following code:
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Upload Test</title> </head> <body> <?php if(isset($_FILES["upload"]) && !empty($_FILES["upload"])){ $imageCount = count($_FILES["upload"]["name"]); if($imageCount > 3){ // More than 4 images uploaded. echo "You can only upload 4 images."; } else if($imageCount == 1 && empty($_FILES["upload"]["name"][0])){ // No image uploaded. echo "No image selected."; } else{ $allowedExt = array("jpg", "jpeg", "png", "gif"); for($i = 0; $i < $imageCount; $i++){ $fileName = $_FILES["upload"]["name"][$i]; $fileSize = $_FILES["upload"]["size"][$i]; $extensionArray = explode('.', $fileName); if( !in_array(end($extensionArray), $allowedExt) ){ // Illegal extension. echo "Only jpg, jpeg, png, and gif are allowed."; break; } else if($fileSize > 2097152){ // File is too big. echo "Maximum allowed size is 2MB."; break; } else{ // Process the image. if(($i + 1) == $imageCount){ // Success message when the last image is processed. echo "Upload successful !"; } } } } } ?> <form action="" enctype="multipart/form-data" method="post"> <input type="file" name="upload[]" multiple="multiple" /> <br /> <input type="submit" value="Upload" /> </form> </body> </html>
Note the name of the input tag.
Because of some reason I haven't figured out yet,
it is necessary to write it in an "array notation" when using the "multiple" attribute otherwise only the last image is processed.
Another ugly thing is that the $imageCount will be 1 if you don't upload any image.
This is because $_FILES["upload"]["name"] will contain an empty array by default, for another mysterious reason...
Hope it helps en succes !
Léon
Ps, multiple file upload is not fully supported yet.
-
Leonvv got a reaction from Lyndsey in Having links target certain DIV'sHello Archer ^^
There are several ways to achieve this, the easiest I think is to change the display of different <div> tags in the same container.
Than you can catch the mouse clicks with javascript.
This is a very simple fiddle to show how it works: http://jsfiddle.net/FEyeL/1/.
It is not very efficient but it works,
a bit faster solution would be to use a loop: http://jsfiddle.net/FEyeL/2/.
You could also use jQuery for this which makes it much simpler.
Hope it helps
Léon
-
Leonvv got a reaction from HighDarren in Help setting up Jquery./Javascript?One tip to get the jQuery working:
try to open the source code in your browser and click on the link in your script tag.
See if it takes you to the page which contains the jQuery code.
If it dosen't, try to add http to your link:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
Léon
-
Leonvv got a reaction from Farg3klatten in Making "Tabs" with different slideshows. Putting a slideshow in a tab?I think the easiest way to achieve this is to have two different slideshows in each tab,
and have the tabs positioned above each other with CSS.
Then you could just change the z-index property of the tab that's being clicked.
Are you familiar with JavaScript ?
Because you will definitely need that.
Léon
-
Leonvv reacted to DappaD in Php Game Programming?Firstly PHP is rarely used in isolation these days, so really what were talking about is a php/javascript game.
Now ask yourself what is the difference between a website and a game is...
I'm sure you have seen that javascript/jquery can be used to create some pretty cool graphical effects and manipulate images in a variety of ways. You can easily pick up keyboard presses and mouse actions, with javascript. And php does a pretty good job of logical processing and content service. So yes of course a combination of web technologies (such as php/js pr php/Flash) could be used to create a game.
There are a number of successful online games built with a php back end - Notably a lot of gambling/poker games and point and click affairs - though much more is possible and out there.
Of course there are realistic limits to what you can do with this approach. Both PHP and js are runtime interpretted languages (slow), neither are really intended for game development (long) and most machines in the public domain dont understand php (not very portble). You certainly wont be putting out the next Call of Duty.
If game development is what your interested in then something like c# with the xna framework would be a much better choice. Following some basic tutorials I managed to get a simple 3d game running with this approach in under an hour. You can also easily port your games for windows desktops/ windows mobile and XBox (I'm told - my tutorial didn't go that far).
-
Leonvv got a reaction from Lovelock in Can i use MAMP to let other view my website?I know there's a feature on OSX called 'Web Sharing'.
Click on the Apple logo in the top left -> System Preferences -> Sharing -> 'Web Sharing'.
I never really used it but I think it's what you're looking for.
Hope it helps,
Léon
-
Leonvv got a reaction from craigpettit in Bottom Border Increases in Size when I reduce Browser SizeHello AblazeRich,
the border comes from the h1.title element, which is floated to the left.
But the float property is declared inside a media query and therefore, if your viewport's width goes below 768 pixels,
it's being removed( main.css , line 348 ).
If you don't use an inspector already( Firebug, or the build in ones from FF and Chrome ) you should try them.
They could have told you this right away.
Léon
-
Leonvv reacted to kree8or in My first CMS - Genius ideas website.Sorry, couldn't resist
-
Leonvv reacted to Lovelock in How much would you quote for this jobJust on another note, please dont spend time putting watermarks on 1500 images...
There is tools available for that
-
Leonvv reacted to zed in Hello, Extro hereNo you're not, you're an Indian pretending to be from the US and can't spell your fake name properly. That's my view and people should be very aware that your hosting company is not as it seems.
-
Leonvv got a reaction from Lovelock in How to add a +1 to rate field in database.Try echo out the query.
I think it should be :
mysql_query('UPDATE products SET rating = rating +1 WHERE id = "' . $_GET["id"]. '"');
And:
mysql_query('UPDATE products SET rating = rating -1 WHERE id ="' . $_GET["id"] . '"');
The problem is that in your query the server is looking for an id of '$_GET["id"]' ,
but you need the value of the variable, not the actual name of the variable.
Hope this helps,
Léon
-
Leonvv got a reaction from snick in Merging Grid Columns & RowsResult after I removed the 'clear:both;' and added a 'bigger' class.
You can add some extra styling to the 'bigger' class to make it look better.
Léon
-
Leonvv reacted to sash_oo7 in Help & suggestions for a websitewordpress can do all what u need
-
Leonvv reacted to sash_oo7 in Help & suggestions for a websitei meant this not this
-
Leonvv reacted to sash_oo7 in Help & suggestions for a website1.You can test wodpress on windows on ur pc with the help of wamp (no need of any domain)
2.Yes you can install wordpress in a separate folder of your existing host and can run your website at the same time .. no poblem with that
3.To install wordpress on 2 separate domains under same host u need to map domains see here
4.to install wordpress on new host you need to install wordpress again there and import the database there
see here
-
Leonvv reacted to webdeveloper93 in Open .php page into lightboxYes