...

View Full Version : Resetting A Function()



7079
12-22-2007, 11:09 PM
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

7079
12-22-2007, 11:45 PM
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

7079
12-24-2007, 08:57 PM
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?

oesxyl
12-24-2007, 10:51 PM
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

7079
12-25-2007, 05:19 PM
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/showthread.php?p=123310&posted=1#post123310

Thanks again!

oesxyl
12-25-2007, 08:03 PM
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/showthread.php?p=123310&posted=1#post123310

Thanks again!

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

happy holydays

Philip M
12-26-2007, 10:16 AM
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".



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum