PHP - Jquery Fade Out Individual Letters
I forgot my password for my old account so had to create a new one. New laptop.
Anyway, I've searched and searched but can't find a jQuery, javascript or anything else to do what I want to do. I want to fade out all the different paragraphs of a div one letter at a time starting with the first.
Here is something CLOSE though the string has to be input. I'm pulling data in from a database with PHP. So not sure if I can target individual letters in different paragraphs.
$(function () { var string = " David"; var q = jQuery.map(string.split(''), function (letter) { return $('<span>' + letter + '</span>'); }); var dest = $('#fadeIn'); var c = 0; var i = setInterval(function () { q[c].appendTo(dest).hide().fadeIn(1000); c += 1; if (c >= q.length) clearInterval(i); }, 1000); });I know I can get my target from a div then split it into characters with something like this: function arrayMe(string) { // For all matching elements $(string).each(function() { var myStr = $(this).html(); myStr = myStr.split(""); var myContents = ""; for (var i = 0, len = myStr.length; i < len; i++) { myContents += '' + myStr[i] + ''; } $(this).html(myContents); }); }Then call the function: $('document').ready(function() { var myStringType = $('.sample-text'); arrayMe(myStringType); });Where my div as a class of sample-text. (These are just code snippets I have pulled from the net in my search for an answer). But using the fade in which nice in jsfiddle, How can I put all these together to fade out my text a single letter at a time? I'm not sure if different paragraphs will work or not or if I'm going to have to have one long paragraph (bad for my application). Thanks for the help here guys. You've always come through for me before. It's just been awhile since I've been stumped. Similar TutorialsHi all, Thanks for reading. I'm running a script using jQuery that auto-refreshes a <div> on the index page from an external PHP script to get all the rows in a database and display them on the index page. The script works great - here it is as follows: Code: [Select] <script type="text/javascript"> $(document).ready(function() { $("#responsecontainer").fadeOut("fast").load("getrows.php").fadeIn("slow"); var refreshId = setInterval(function() { $("#responsecontainer").fadeOut("fast").load('getrows.php').fadeIn("slow"); }, 5000); $.ajaxSetup({ cache: false }); }); </script> The getrows.php script I'm working with looks like this: Code: [Select] <?php $rowsQuery = mysql_query("SELECT * FROM Happenings WHERE HappeningDate='$today'"); if (mysql_num_rows($rowsQuery) == 0) { $happeningsToday = "There are no happenings today."; } else { $allHappeningsToday = 1; while ($getHappeningsToday = mysql_fetch_array($rowsQuery)) { $happeningName = stripslashes($getHappeningsToday['HappeningName']); $happeningDate = $getHappeningsToday['HappeningDate']; $happeningDescription = $getHappeningsToday['HappeningDescription']; if ($allHappeningsToday == 1) { $happeningsToday .= " <div class=\"box\"> <p>".$happeningName." | ".$happeningDate." | ".$happeningDescription." </div>"; $allHappeningsToday = 2; } else { $happeningsToday .= " <div class=\"box\"> <p>".$happeningName." | ".$happeningDate." | ".$happeningDescription." </div>"; $allHappeningsToday = 1; } } } echo $happeningsToday; ?> This script works great as well. Currently, the auto-refresh jQuery script as you can see if getting and fading in/out all of the rows. Off of the above getrows.php script, is there a way after I could get only the newly created rows since the last refresh and only fade those in and out while leaving the others already loaded by the auto-refresh script to not fade in/out? Any ideas, thoughts or suggestions would be unbelievably helpful. Thank you very much. I am having problems displaying individual data I am using $filename[0] to display the first data, any ideas where i am going wrong. <?php $active_keys = array(); foreach($_POST['img'] as $key => $filename) { if(!empty($filename)) { $active_keys[] = $key; } echo "". $filename[1]; } ?> I want the user to input there name, then have a php script to find the memeber in a members database and then grab the whole row by the user name. so if my db has 3 colums id, user, password, then want it to take out all three fields based on the users name. Can anyone help me? I figure I'd use array_chunk to divide my array by 5's, but how can I get each set of five to be enclosed in div tags. My array is a list of images in a directory which I need inserted into a format like the example code on this page. http://flowplayer.org/tools/demos/scrollable/index.html. Thanks for any help. This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=313049.0 Hi all, I have used this script to pull twitter updates to my website and it works great: http://www.inkplant.com/code/pull-twitter-feed-into-your-site.php I was wondering if anyone could help me modify it so that it links to the individual twitter posts such as: http://twitter.com/user/status/4528454817693440 Thanks! Hello my mysql db got row pageurl pageurl http://www.google.gr http://www.yahoo.com http://www.phpfreaks.com i whant to echo 11,12,13 letter only ***********goo****** but i whant to show and count the ******* how can i do this? any idea? Hi Guys
I have a regex conundrum that at first I thought would be very easy but then appears to be quite hard :/
I want to match a string with a regex where the regex can only pass if it contains letters and numbers (nothing else) and it has to contain at least one of each.
I've been trying out lookaheads but just can't get it right.
Any help is appreciated.
Drongo
How in php using the preg_replace php function can i allow only the basic english a-z letters, numbers 0-9 and unicode code letters and remove anything else? I have been banging my head against a wall for a few days over this and think that I have read so many alternative ways, I have got myself confused! What I am trying to do is post some information into the database and on success, provide certain variables back to my script (for example last_insert_id) as I would like to show a success message an add an option to a select on that page. I am trying to get this part working without the mysql first just so I understand it. Currently I can post the data, have that received successfully in the processing page (addDetail.php) and send back output from that page........ insert.php $("#sub").click(function() { var name = $("#name").val(); var town = $("#town").val(); jQuery.ajax({ type: "POST", url: "postScripts/addDetail.php", data: 'name='+name+'&town='+town, success: function(html) { $(".modal-body").prepend( "Returned: " +html ); } }); return false })addDetail.php $name = $_POST['name']; $town = $_POST['town']; //Check $_POST data echo "<pre>"; print_r($_POST) ; echo "</pre>"; $return["name"] = $name; $return["town"] = $town; echo json_encode($return); Result in insert.php Returned: Array ( [name] => The Name [town] => The Town ) {"name":"The Name","town":"The Town"}This works fine to bring back everything on the processing page in one go but I want to bring back separated variables so I can use them individually. I thought that changing "Returned: " +htmlto "Returned: " +html.namewould allow me to bring back just that variable but it comes back undefined. This is the closest I have got as other methods I tried either brought nothing back or just [objectObject]. How would I be able to bring back both 'name' and 'town' as separated values so I can use them individually in my script? Thanks in advance Steve Edited by MargateSteve, 29 September 2014 - 08:41 AM. Hey everyone I'm pulling data from my db and then trying to store each value to its own var. the problem is the amount of values is always changing. here is what I have that isnt working $result = mysql_query("SELECT thismonth FROM list"); while($row = mysql_fetch_array($result)) { echo $row[0] . "<br>"; // this prints out all the values perfectly } no I just dont know how to store them so i can use them later. I've got my code working OK in that the correct results are drawn from the database. What I have here in the code is an array consisting of an image, accompanied by its title and thirdly a link to activate a quiz associated with the image. Everything works fine, except because the page is dynamic, I always have an unknown number of sets of data (image, title and link) which I want to display so that each set of data takes up a new row. The code I have here, while displaying the correct data, places all of the results into the same row. Any suggestions are most welcome. Code: [Select] <?php // Query the database $query1 = mysql_query("SELECT title FROM topics WHERE managerId='".$managerId."' AND egroup1='"."1"."' ORDER BY title ASC"); $query2 = mysql_query("SELECT url_small FROM topics WHERE managerId='".$managerId."' AND egroup1='"."1"."' ORDER BY title ASC"); $query3 = mysql_query("SELECT title FROM topics WHERE managerId='".$managerId."' AND egroup1='"."1"."' ORDER BY title ASC"); while($row1 = mysql_fetch_array($query3)) { $linkname .= $row1['title']."<br />\n"; } ?> <table> <tr> <td> <?php while ($row2 = mysql_fetch_array($query2)) { $thumbnail.= $row2['url_small']; echo "<img src='wood_tool_images/{$row2['url_small']}' alt='' /><br />\n"; } ?> </td> <td height="200"> <?php echo $linkname ?> </td> <td> <?php while ($row1 = mysql_fetch_array($query1)) { $quizname.= $row1['title']; echo "<a href='../{$row1['title']} Safety Quiz/{$row1['title']} Safety Quiz.php'>Take This Quiz</a><br />\n"; } ?> </td> </tr> </table> Does anyone knows if FPDF supports Norwegian letters or not? When I write codes of letters it is not showing letter. Are there any command to specify charset? For example in this code is it possible to specify charset? $pdf=new FPDF(); $pdf->AddPage(); $pdf->SetFont('Arial','',14); $pdf->Write(5,'Følgende '); Would someone tell me how to allow foreign letters, normal english letters and numbers using the preg_replace php function? I'm looking for a function that will check a string for letters and spaces...boolean preferibly Hello, I have a script coded in PHP and alot of JavaScript and I have problems with languages like Arabic and Hebrew ( non Latin characters) .. It is showed as question marks in the website like this ( ?????????) and in the database .. I converted the SQL Database from Latin Swedish to UTF-8 in phpmyadmin and now the database is correct but the website is still in question marks . In every HTML code you can see this : ........... content="text/html; charset=utf-8"/> and I tried changing the same php pages to UTF-8 using text editors but nothing happened . any help will be great. thanks. I have a database query set up that returns an array. I then cycle through the rows in a foreach statement that wraps each value in a <td> tag to output it to a table. It works really great, but now I need to access two of the values and add some info to them. The first field returned is an image filename and I want to wrap it in an image tag that also concatenates the image path location to the value. All the images are stored in the same location, so basically I want to take the first value form the array and add the path to where the images are and wrap the whole thing in an <img> tag. The other field I need to modify is the last value in the array which is actually an email address. For that field I want to make them an active email link so I need to wrap an <a>href=mailto: </a> tag around the value. How could I modify this code so I could add the necessary tags to these elements of the array? Here is the code I am running: Code: [Select] $query = "Select member_image as 'Image', member_name as 'Name', city as 'City', phone as 'Phone', email as 'Email' FROM directory"; //connect to database $conn=db_connect(); //call function do_query to run the query and output the table do_query($conn, $querey); The functions called are as follows: Code: [Select] function db_connect() { $conn = new mysqli("localhost", "username", "password", "databasename"); } function do_query($conn, $query); { $result = mysqli_query($conn, $query); WHILE ($row = mysqli_fetch_assoc($result)) { If (!$heading) //only do if header row hasn't been output yet { $heading = TRUE; //so we only do it once echo "<table>\n<tr<>\n"; foreach ($row as $key => $val) { echo "<th>$key</th>"; } echo "</tr>\n"; } echo "<tr>"; foreach ($row as $val) { echo "<td> $val </td>"; } echo "</tr>\n"; } //close the while echo "</table>\n"; } Hi I am trying to build a site which has an image gallery with links on it. I want to list the the images in different ways and I have successfully made it work with a "shuffle"-script like this: Code: [Select] <?php $links[] = Array("../r/ahlens.html", "k/k.jpg"); $links[] = Array("../r/brothers.html", "k/k.jpg"); $links[] = Array("../r/hm.html", "k/k.jpg"); $links[] = Array("../r/kappahl.html", "k/k.jpg"); $links[] = Array("../r/mq.html", "k/k.jpg"); $links[] = Array("sida1.php", "k/l.jpg"); $links[] = Array("../r/kappahl.html", "k/k.jpg"); $links[] = Array("../r/mq.html", "k/k.jpg"); $links[] = Array("../r/nk.html", "k/k.jpg"); shuffle($links); foreach($links as $link){ echo "<a href=\"${link[0]}\" ><img src=\"${link[1]}\" class=\"randomImage\" /></a> "; } ?> It works fine and opens a new page when clicked. Now I would like to make it listed by file name instead of shuffling. How do I do that without loosing the links? And can it be done with a Directory because there will be a lot more photos in the future? (I would also like the link to pages to be opened in a nice popup. Can I implement that?) Thanks in advance! Dear all, I would like to find the total number of individual record in MySQL with php. For example: I have different department name stored in a column in MySQL. I would like to find out the total number of each department. But I do not know the names of the department How can I do it?? Counting the total of each department without knowing their names Thanks! Hello!
I have five websites on a single server, and each website uses the same geographic data, for instance US zip codes and city/state latitudes and longitudes. Each website uses it's own copy of these "large" tables.
I would like to avoid having to maintain the same data in 5 databases, but I am more concerned with database performance, e.g., the speed at which the data is retrieved for each website.
Question: Should I set up a new separate database that contains the shared tables for all websites and allow each website to connect to this new database for shared data? Or is it better for each website have it's own copy of the duplicate tables?
Thanks for any info!
Cheers
|