Jump to content

chronister

Members
  • Posts

    1,438
  • Joined

  • Last visited

About chronister

  • Birthday 03/17/1978

Profile Information

  • Gender
    Not Telling

chronister's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Hi Folks... Hope everyone is doing well today! I have researched this and cannot determine how to do this. Any help here would be appreciated. I have a div area that shows a set of images pulled from a directory. I have a dblClick event working on a label around them for the first load that changes the src of another element to the src of the clicked image (edit in place system for website) and goes away so the page can be saved with the new image. When I upload a new image via ajax and then refresh this area to display the newly uploaded file, my dblClick event no longer works. I remember seeing this has to do with explicitly binding the click event to the dynamically created elements. I cannot find any information on how to bind a dblClick event to my img elements after I refresh the section. Here is the code I am working with. This is all inside a document ready block just to clarify. This is the dblClick event that gets attached to the label $('.newimageContainer label').on("dblclick",function(e){ // Get the src of the img below the label that was clicked imgSrc = $(this).children("img").attr('src') // Set the src of the prior selected page image to the new src $('.changing').attr("src", imgSrc); // close modal modal.close(); }); Here is the code that does the replacing of data. It is the complete callback inside an ajax function. complete: function(){ // STOP LOADING SPINNER AND DISPLAY MESSAGE $('.msgArea').html('<strong>SUCCESS: File Uploaded</strong>'); // Clear the html inside the image picker $('#imagePickerWrapper').html(''); // reload and load the new set of data into the image picker area $('#imagePickerWrapper').load( "/lib/php/updatePage.php .images" ); } It is after this .load method gets called that my dblClick stops working. If anyone can help, I would appreciate it very much... Here is the HTML block for the image picker area (with the php function call) <div id="imagePickerWrapper"> <span class="images"><?php echo displayUserImages(); ?> </span></div> Thanks, nate
  2. I think I got it.. but what say ye javascript gurus.... Jessica, it was not opening the found / lost main section when the 1st level ul li item was clicked. But the 2nd level li items would show those individual sections. I have changed the jquery and it does work as intended, but I think it could be better. <script> $(function(){ $('#lost_cats, #found_cats, #lost_dogs, #found_dogs').hide(); $("#lost-and-found a").click(function(event) { var href = $(this).attr('href'); $('#lost_cats, #found_cats, #lost_dogs, #found_dogs').hide(); $(href).show(); $(href).children().show(); event.preventDefault(); }); }); </script> Not I am not using chrome dev tools or firebug (though I do have it installed.. I think) Is the code here ok or do you have a suggestion to make it better? I think it is probably clumsy.
  3. Hello all, How is everybody doing today?? I am trying to get an unorderd list as trigger to toggle / expand some div's and I am struggling on this. Can someone point me in the right direction? <div id="lost-and-found"> <ul> <li><span><a href="#lost">Lost Animals</a></span> <ul> <li><a href="#lost_cats">Cats</a></li> <li><a href="#lost_dogs">Dogs</a></li> </ul> </li> <li><span><a href="#found">Found Animals</a></span> <ul> <li><a href="#found_cats">Cats</a></li> <li><a href="#found_dogs">Dogs</a></li> </ul> </li> </ul> <div class="clear"> </div> </div> <div id="found"> <div id="found_cats"> <h2>Found Cats</h2> <?php display_lf($found['cat']); ?> </div> <div id="found_dogs"> <h2>Found Dogs</h2> <?php display_lf($found['dog']); ?> </div> </div> <div id="lost"> <div id="lost_cats"> <h2>Lost Cats</h2> <?php display_lf($lost['cat']); ?> </div> <div id="lost_dogs"> <h2>Lost Dogs</h2> <?php display_lf($lost['dog']); ?> </div> </div> <script> $(function(){ $('#lost_cats, #found_cats, #lost_dogs, #found_dogs').hide(); $("#lost-and-found a").click(function(event) { var href = $(this).attr('href'); $('#lost_cats, #found_cats, #lost_dogs, #found_dogs').hide(); $(href).show(); $(this).parent("div").show(); event.preventDefault(); }); }); </script> The ul is 2 buttons (Lost / Found) with Cat and dog under each. I have a div with id of lost and one with found. Inside each, there lost cat, lost dog and found cat, found dog respectively. I am trying to hide all sections initally with jquery and then open the lost / found section or the subsections of lost -> dog, lost -> cat, found ->dog, found -> cat. Any tips / pointers will be appreciated.
  4. Yeah, it appears to be just normal form field processing. You can use the whole mask thing, but I find it annoying when the page dictates what can be entered via javascript. I would just make it so you can accept any time format and then make it the format you want. I disagree with this. At first it makes it easy as the rules are not so tight as to how it is formatted... but if you need to do any kind of query past SELECT this FROM that you may have trouble. When I started, I would store dates and times in a varchar field and it made it easy, until I needed to select dates and times between 2 points, or dates where it falls on a particular day.. Store dates and time as the proper format, it will become easier as time goes.
  5. $image->save('uploadedphotos/'.$picturename.'.jpg'); You have to have the additional periods to properly concatenate the string.
  6. Because with the new video and audio tags, they are not real easy to use. There is no 1 format that works across all browsers and some browsers don't even support them at the moment (I am looking in your direction IE).
  7. Look at the server superglobals. $_SERVER[] ... there are a few that may do what you want.. the one off the top of my head is $_SERVER['PHP_SELF'] As for the video, you will probably have to look into a custom player ( or use HTML 5's video tag (read long and hard about this before you use it)
  8. Use CURL to submit the request behind the scenes. You will need to set up a cron job to run the target PHP script at a particular time and frequency. Nathan
  9. <?php for($x = 0; $x < 10; $x++) { echo "hello"; sleep(10); ob_flush; flush(); } ?> This will stop the infinite loop and only allow this to run 10 times.
  10. Yeah, to give you some code to get you started would be difficult because I have no idea what you have already. If you have done something similar for registration, meaning the generate a hash and email it and validate it on confirmation, then you have the process. Just do it again for this system.
  11. Typically, passwords are hashed using a one way encryption. I don't use any "recover" lost passwords. I reset them. You generate a hash string and store it in the database with their user account after verifying their username and email address. Then you send an email to them with that string as a URL parameter. They click the link and it comes back to your site which validates the hash string and allows them to reset the password. You can use the security question to validate them in the same steps as the username and email combination. Nate
  12. Yeah, those are both better options if the end users are knowledgeable of these things. But the last project I completed which I implemented the mentioned upload script, the user is not savvy enough to zip files up and upload that single zip file nor do they have any idea what FTP is, how to use it or care to learn. I attempted to do a zip file upload script before and had trouble getting the individual file names. That was on PHP 4, I know that PHP 5 has some better zip handling functions.
  13. Just by way of how HTML forms work, they will not allow multiple files to be uploaded at one time. That is just the HTML specs. The only way to get around it is to use a Flash based uploader (thats what Gmail uses) or something similar. I just implemented a multiple file upload using a jquery based script found at http://valums.com/ajax-upload/ It works great and does not rely on flash.
  14. Yeah, CSS is what you are looking for. I build most all of my sites as fixed width sites. I currently build for a max width of 960px. That will ensure that anyone using 1024x768 resolution will not have to scroll side to side. Anyone using less than that is a small enough group (for my targets anyway) that I am not concerned.
  15. I know but i need to meet a deadline for tonight. LOL... I love it when folks are all like "I have a deadline to meet and don't know what I am doing.... save me". I mean I am not going to tell someone I will rebuild their car by tomorrow night, knowing full well I am not a mechanic. too funny. Folks need to fail and learn not to oversell their abilities rather than having others bail them out. Not trying to be a dick or anything, but your deadline is of no concern to the folks who donate their time for free on here.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.