Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Jul 2006
    Posts
    45
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Resetting A Function()

    I am in the need of resetting a function but cannot find anything on how to do that. I believe the "reset" wording I'm using is the issue. I have 4 functions in my script:

    function fadeOut(){
    var effect = new Spry.Effect.Opacity("targetID", 1, 0.2, {duration: 300, toggle: false});
    effect.start();
    }

    function fadeIn(){
    var effect = new Spry.Effect.Opacity("targetID", 0.2, 1, {duration: 300, toggle: false});
    effect.start();
    }

    function displayDetails(trgt) {
    var effect = new Spry.Effect.Fade(trgt, {duration: 300, toggle: false, from: "0%", to: "100%", setup: fadeOut});
    effect.start();
    }

    function closeDetails(trgt) {
    var effect = new Spry.Effect.Fade(trgt, {duration: 300, toggle: false, from: "100%", to: "0%", setup: fadeIn});
    effect.start();
    }

    When called the first time, everything works fine, but when I call them the 2nd time without refreshing the page, they don't work at all. Does JS cache anything to the client's browser? Maybe it has something to do with that, not sure.

    Please offer any advice or suggestions.

    Thanks,

    7079

  • #2
    New Coder
    Join Date
    Jul 2006
    Posts
    45
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Here's a link to the demo script:

    http://7079.net/spry/

    If you click the "Click Me1" link, a hidden div appears in the middle of the screen and the background fades out. When you click "close1" inside the visible div, it will close and remove the fade effect from the faded div. The problem with this is that when you go back the 2nd time to click the "Click Me1" link again, it fades but does not show the hidden div.

    I'm not a JS expert, I am at a disadvantage without knowing the proper syntax to fix the problem. If anyone can help, that would be fantastic!

    Thanks again,

    7079

  • #3
    New Coder
    Join Date
    Jul 2006
    Posts
    45
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Are my posts being skipped because my Thanks are 0?

    This should be a fairly simple answer for someone proficient with Javascript, I don't understand why posts go unanswered.

    Can anyone please help?

  • #4
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by 7079 View Post
    Are my posts being skipped because my Thanks are 0?
    I don't think. Is christmas, end of the year and people must know the answer, isn't it?

    This should be a fairly simple answer for someone proficient with Javascript, I don't understand why posts go unanswered.

    Can anyone please help?
    My js knowladge are limited but:
    - try to remove the inline style declaration of the element, visibility and display from the html page.
    - look inside SpryEfect.js and see who is responsable with setting display of the div to none and block, see also if and what variable or attribut use and try to watch with a js debuger

    sorry that I can't help you more then that.

    best regards

  • Users who have thanked oesxyl for this post:

    7079 (12-25-2007)

  • #5
    New Coder
    Join Date
    Jul 2006
    Posts
    45
    Thanks
    1
    Thanked 0 Times in 0 Posts
    oesxyl,

    I appreciate the reply and the attempt, it is very worthy!

    I was referring to prior posts, not just the Xmas time posts. I'm not sure if I offended anyone, and to be honest, I didn't realize there was a rating for thanking people. I am always very humble and thankful, and i apologize to anyone in the past who helped me that I didn not thank, it was not intentional.

    Here is the solution from another forum, I hope this helps anyone who has faced similar issues. It has opened my eyes to other things I need to look out for in my scripts.

    http://dynamicdrive.com/forums/showt...d=1#post123310

    Thanks again!

  • #6
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by 7079 View Post
    oesxyl,

    I appreciate the reply and the attempt, it is very worthy!

    I was referring to prior posts, not just the Xmas time posts. I'm not sure if I offended anyone, and to be honest, I didn't realize there was a rating for thanking people. I am always very humble and thankful, and i apologize to anyone in the past who helped me that I didn not thank, it was not intentional.
    I think that real reason is that starting with 21 dec, and probably until 7 jan next year, the activity on the forum is low. As sun as they don't need help people are bussy with holydays, .

    Here is the solution from another forum, I hope this helps anyone who has faced similar issues. It has opened my eyes to other things I need to look out for in my scripts.

    http://dynamicdrive.com/forums/showt...d=1#post123310

    Thanks again!
    with pleasure, any time, next time I hope to really help.

    happy holydays

  • #7
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,078
    Thanks
    203
    Thanked 2,542 Times in 2,520 Posts
    Quote Originally Posted by 7079 View Post
    oesxyl,

    I was referring to prior posts, not just the Xmas time posts. I'm not sure if I offended anyone, and to be honest, I didn't realize there was a rating for thanking people. I am always very humble and thankful, and i apologize to anyone in the past who helped me that I didn not thank, it was not intentional.
    You have not offended anyone, and the number of thanks given has nothing at all to do with it. Your problem was one which I was unable to help you with - simple as that. I know nothing at all about Spry - never even heard of it in fact. Doubtless other forum members were in the same position. In fact it required someone with the rank of Global Moderator and over 12,000 posts to guess or deduce the answer. And as has been pointed out it is Christmas time with many people on holiday.

    As they say, "Just because I am paranoid that does not prove that they are not out to get me".


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •