Search Results

Search found 4 results on 1 pages for 'estern'.

Page 1/1 | 1 

  • Comparing two date / times to find out if 5 mins has lapsed between the two times php

    - by estern
    I need to compare two dates to show an edit link if it is within 5 mins after the post was made, in php. If after 5 mins dont show anything. $answer_post_date = get_the_time("Y-m-d"); $current_date = date("Y-m-d"); $formated_current_date = strtotime($answer_post_date); $formated_answer_post_date = strtotime($current_date); At this point i have two values: 1274414400 ($formated_current_date) 1276056000 ($formated_answer_post_date) I am not sure what to do next to check if the current date/time is ! 5 mins from answer post date. Any suggestions would be great All i really need the answer to be is a Boolean (yes/no) and if yes display the minuets left to show the link to edit.

    Read the article

  • Dynamically writing out li with jquery. Element is not clickable after being written

    - by estern
    I have have a a function that when a checkbox is checked i dynamically write out an li into a ol that is empty. Code: $(":checkbox").click(function() { var checkedState = $(this).is(':checked'); if (checkedState == true) { var productName = $(this).attr("title"); $("#selectedProductsList").append("<li class=\"productList " + this + "\"><p class=\"removeIcon\"><img src=\"images/remove-icon.png\" alt=\"Remove Product\" /></p><span class=\"productName\">"+ productName +"</span></li>"); }; }); Then when that writes out there is a remove icon that will remove the item from the ol when clicked. This remove icon has a class of removeIcon which can be seen in the dynamic li above. I have a function that processes the remove call and then does some actions: Code: $('.removeIcon').click(function() { alert("starting"); }); Right now i have the remove action just trying to alert a message that it got called. But it seems that it is not getting into the function. Is there a certain way that i need to access these dynamic li's other then the .click method? I saw this post: Dynamically Inserted DOM Elements are not Clickable using $.click() Where they added .live vs .click but this doesn't seem to work either. Any ideas?

    Read the article

  • jquery dynamically added checkbox not working with change() function

    - by estern
    I dynamically load in a few li's that have a label and a checkbox in them to another visible ul. I set the checkboxes to be checked="checked" and i am trying to trigger an event to happen when i change these dynamically inserted checkboxes but nothing occurs. Here is the jquery: $(".otherProductCheckbox:checkbox").change( function(){ alert('test'); }); Here is the html for the dynamically added li's: <li class="otherProduct"><input type="checkbox" class="otherProductCheckbox radioCheck" checked="checked"/><label>Product Name</label></li> Any idea why i cant get the alert to happen when the checkbox changes its checked state?

    Read the article

  • jquery scroll to a px count from top and then set a div to be fixed from the top for the rest of the scroll

    - by estern
    I am looking to change a div's css when i scroll to a certain point down the page, a certain amount of pixels from the top of the page. On page load i would have a div positioned statically. Once I started to scroll down the page and i hit a point from the top (say 100px for demo purposes) i want to change that static div to become fixed like 20px from the top. Which would be done via the css() property of jquery. THis would allow it to stay at that fixed 20px all the way down the page. What jquery property can i use to know when i hit that 100px mark. I want this to also revert once someone gets back to the top so that the div is put back to where it was when the page loaded and not 20px from the top. Any ideas?

    Read the article

1