execute code on real time

Discussion in 'jQuery' started by supercain, Oct 17, 2013.

  1. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #21
    Ok, fixed that. Duh, local wasn't throwing an error on attempting to array_merge an empty or error result. New version uploaded.
     
    deathshadow, Oct 26, 2013 IP
  2. supercain

    supercain Greenhorn

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #22
    Hi,

    thanks, Ill give it a try. In fact only 2 people will be seeing it at the same time. Me and a colleague.
     
    supercain, Oct 26, 2013 IP
  3. supercain

    supercain Greenhorn

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #23
    Hi,

    i just tested your code. Looks great but there is something wrong with imagesWithControls.php because when i hit next it goes next but jumps back to the previous image most of the times. Can that be fixed?
     
    supercain, Oct 28, 2013 IP
  4. supercain

    supercain Greenhorn

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #24
    Hello? Im trying to fix the jumpy issue but i cant. Please help me one more time.
     
    supercain, Oct 29, 2013 IP
  5. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #25
    The most likely cause is a caching issue -- the update is reading a cached copy instead of the updated one. I'll see if I can find a way to play with cache-control to get around that -- either that or we have to disable the buttons and wait for the update to actually go through, then re-enable them.

    Could simply be that trying to mix the update and show routines into one isn't viable...
     
    deathshadow, Oct 31, 2013 IP
  6. supercain

    supercain Greenhorn

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #26
    Cant the cache be disabled for the page?
     
    supercain, Oct 31, 2013 IP
  7. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #27
    Doesn't have to be the whole page, just that one file.

    But I think a better approach would be to make the 'write' routine not update the current page -- I'm a bit busy now but I'll toss together a better demo.

    ... have a client from a decade ago come a knockin' on my door, having issues with their FINALLY upgrading to PHP 5.4 and they're hemorrhaging 'deprecated function' errors.
     
    deathshadow, Oct 31, 2013 IP
  8. supercain

    supercain Greenhorn

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #28
    Thank you man. You really saved me.
     
    supercain, Oct 31, 2013 IP
  9. supercain

    supercain Greenhorn

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #29
    Hi, how is it going? Got a little free time now?
     
    supercain, Nov 13, 2013 IP
  10. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #30
    Sorry there, lost track of things. I'll try to revisit this tonight.
     
    deathshadow, Nov 13, 2013 IP
  11. supercain

    supercain Greenhorn

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #31
    Thank you pal.
     
    supercain, Nov 13, 2013 IP
  12. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #32
    I just realized the possible conflict -- if you clicked on previous/next in the middle of a ajax request waiting, you'd have a set and get conflicting with each-other. I added a 'ignore' variable to ignore the current request (cancelling a request is a PITA) until after the SET goes through. Cleans up most of the issue.

    Though I'm still trying to figure out why the CSS animation is 'wonky' switching from 'forward' to 'back' and vice versa. I think it's because switching directions it's still set to previous instead of classless.

    -- edit -- nabbed the animation bug too. '.previous' was set to opacity 1, which is fine going single direction, but on revisit it needs to be zero. Setting it to zero breaks the animation unless you set up a delay on the transition... so changing it from:

    opacity:1;

    to:

    opacity:0;
    transition: opacity 1s 0;

    did the trick. 1 second delay, 0 transition time.

    Fixed bug free version uploaded to the same spot. Sorry for the delay.
     
    Last edited: Nov 14, 2013
    deathshadow, Nov 14, 2013 IP
  13. supercain

    supercain Greenhorn

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #33
    Thank you pal! Seems to work BEAUTIFULLY now! I really appreciate your help. Im trying to understand the code so i can try doing it myself next time. Its kinda complicated to me.
     
    supercain, Nov 15, 2013 IP
  14. supercain

    supercain Greenhorn

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #34
    Hi, sorry to disturb you yet again but seems like the jumpiness problem persists. Not all the times but quite often the current image still jumps back to the very first one. Could you please check it out? Im still unable to find the culprit. Thank you!
     
    supercain, Nov 17, 2013 IP
  15. supercain

    supercain Greenhorn

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #35
    Can anybody else please help me out with this?
     
    supercain, Dec 3, 2013 IP
  16. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #36
    I'm unable to recreate what you describe right now... makes it hard to fix. Can I see your version to see what's going on?
     
    deathshadow, Dec 3, 2013 IP
  17. supercain

    supercain Greenhorn

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #37
    Im sending the link by PM. Please check it out.
     
    supercain, Dec 4, 2013 IP