[Proto-Scripty] Re: how to set focus after using an effect?

2009-05-26 Thread Chris

Hi Claus,

 Hello again, thanks a lot, further dumb question: Where should I have
 looked for that in the first place?

there is some good information about such stuff in the scriptaculous
wiki (http://wiki.github.com/madrobby/scriptaculous), available
callbacks are explained here: 
http://wiki.github.com/madrobby/scriptaculous/core-effects.
Also, there is the unofficial prototype and scriptaculous wiki (http://
proto-scripty.wikidot.com/) where you can get some information at.

If you are like me and need some non virtual stuff to learn (I know
thats not so Web2.whatever...), there are two books you can learn a
lot from (even if you think you know the framework like I did):

Practical Prototype and script.aculo.us:
http://www.amazon.de/Practical-Prototype-script-aculo-us-Experts-Development/dp/1590599195
Prototype and script.aculo.us:
http://www.amazon.de/Prototype-script-aculo-us-JavaScript-Pragmatic-Programmers/dp/1934356018/ref=pd_sim_eb_3

If you have some experience, I would recommend to stick with the
second one (Prototype and script.aculo.us), but thats only my point of
view. The contents of the books are merely the same (they both handle
the same functions and stuff), but Prototype and script.aculo.us seems
to be written a bit more professional. Both books are worth the money,
however.

Greetings from Germany,
Chris
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: evalScripts and functions

2009-05-26 Thread T.J. Crowder

Hi David,

 Could you please point me out where it is written, I've perhaps miss
 something.

It's cleverly hidden on the docs for Ajax.Updater:
http://prototypejs.org/api/ajax/updater

A better place would (obviously) be on String#evalScripts, which
someone helpfullly pointed out by opening a ticket in Lighthouse a
while back (https://prototype.lighthouseapp.com/projects/8886-
prototype/tickets/38).

HTH,
--
T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available

On May 25, 6:25 pm, david david.brill...@gmail.com wrote:
 Hi Mickael,

 I just look at the prototype documentation, and did not find any note
 about:

  According to the Prototype documentation, you need to declare the
  function and assign it to a global variable:

  myFunction = function() {alert('hi');}

 Could you please point me out where it is written, I've perhaps miss
 something.

 Because for me, there is no much difference in JS between:
 var myFunction=function(){alert('myFunction');}
 and
 function myFunction(){alert('myFunction');}
 that should return a function named myFunction that in both case could
 be called as myFunction().

 I think you could define your function the way you want even in an
 AJAX call, because it's just handle (in certain case) the call to the
 eval() method which will only evaluate the JS code.

 For you're exemple, I think that
  var myFunction = function myFunction() {alert('hi');}  just create a
 function called myFunction and assign this function to a variable
 called myFunction, that result in a function called myFunction() == I
 think it is redondant.

 --
 david

 On 24 mai, 16:24, Michael mich...@michaelminella.com wrote:

  I understand how Prototype works with regards to the removal of
  script tags after evaling the results of an Ajax request.  However,
  I was doing some research and am now starting to wonder why the way I
  declare functions works.

  According to the Prototype documentation, you need to declare the
  function and assign it to a global variable:

  myFunction = function() {alert('hi');}

  That makes sense.  However, in all of my scenarios, I've declared
  functions like this:

  var myFunction = function myFunction() {alert('hi');}

  and the calls to myFunction work just fine.  My question is...why does
  my way work?  According to the Prototype documentation, the local
  variable myFunction should be thrown away after the eval.  Any insight
  anyone can provide would be appreciated.  Thanks in advance!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: evalScripts and functions

2009-05-26 Thread ColinFine



On May 24, 3:24 pm, Michael mich...@michaelminella.com wrote:
 However, in all of my scenarios, I've declared
 functions like this:

 var myFunction = function myFunction() {alert('hi');}

 and the calls to myFunction work just fine.  My question is...why does
 my way work?  According to the Prototype documentation, the local
 variable myFunction should be thrown away after the eval.  Any insight
 anyone can provide would be appreciated.  Thanks in advance!

According to Flanagan's book (section 8.1.2) the optional function-
name in a function literal is not assigned to a variable, but
apparently lives in a special namespace of its own that allows the
function to refer to itself. So unless the function is recursive, the
above is identical to

var myFunction = function() {alert('hi');}

and more or less identical to

function myFunction() {alert('hi')}
(which is a function *statement* not a function *literal*, and so has
different syntax, with the name being required.)

Crockford, in Javascript: The Good Parts describes function
*statements* as  one of the Bad Parts (appendix B), and recommends
avoiding them, in favour of the

var f = function() {}

form.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: evalScripts and functions

2009-05-26 Thread david

@TJ,
thanks for the links, as you say, it's cleverly hidden. Perhaps I'm
not enough curious !!

@ColinFine,
 According to Flanagan's book (section 8.1.2) the optional function-
 name in a function literal is not assigned to a variable, but
 apparently lives in a special namespace of its own that allows the
 function to refer to itself. So unless the function is recursive, the
 above is identical to

 var myFunction = function() {alert('hi');}

 and more or less identical to

 function myFunction() {alert('hi')}

I try to refer to myFunction recursivelly and in both case it works
(test done on FF3.0).
could you send me an exemple of what you say ?
I'd only though the difference was in the scope of the created
function depending on the way it is declare as a *statement* or as a
*litteral*.

--
david

On 26 mai, 12:53, ColinFine colin.f...@pace.com wrote:
 On May 24, 3:24 pm, Michael mich...@michaelminella.com wrote:
  However, in all of my scenarios, I've declared

  functions like this:

  var myFunction = function myFunction() {alert('hi');}

  and the calls to myFunction work just fine.  My question is...why does
  my way work?  According to the Prototype documentation, the local
  variable myFunction should be thrown away after the eval.  Any insight
  anyone can provide would be appreciated.  Thanks in advance!

 According to Flanagan's book (section 8.1.2) the optional function-
 name in a function literal is not assigned to a variable, but
 apparently lives in a special namespace of its own that allows the
 function to refer to itself. So unless the function is recursive, the
 above is identical to

 var myFunction = function() {alert('hi');}

 and more or less identical to

 function myFunction() {alert('hi')}
 (which is a function *statement* not a function *literal*, and so has
 different syntax, with the name being required.)

 Crockford, in Javascript: The Good Parts describes function
 *statements* as  one of the Bad Parts (appendix B), and recommends
 avoiding them, in favour of the

 var f = function() {}

 form.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Expandable Detail Table Rows

2009-05-26 Thread david

Hi again jef,

on scripteka, just look at the TableKit, it could handle what you
need.

--
david

On 26 mai, 13:47, david david.brill...@gmail.com wrote:
 Hi jef,

 the repository of prototype script is athttp://scripteka.com/
 Have a look, and you'll probably found what you need (I hope).

 --
 david

 On 24 mai, 14:28, Walter Lee Davis wa...@wdstudio.com wrote:

  There's lots of ways to skin this cat. Do you want to load the detail  
  data in using Ajax? Do you just want to have it lurking in a hidden  
  span and show it after a click? What does your basic page look like,  
  and how much detail do you want to show?

  Walter

  On May 23, 2009, at 5:34 PM, jef wrote:

   Hi there

   I'am looking for a nice script, on top of prototype,  that can do that
   in a sexy way.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Expandable Detail Table Rows

2009-05-26 Thread david

Hi jef,

the repository of prototype script is at http://scripteka.com/
Have a look, and you'll probably found what you need (I hope).

--
david

On 24 mai, 14:28, Walter Lee Davis wa...@wdstudio.com wrote:
 There's lots of ways to skin this cat. Do you want to load the detail  
 data in using Ajax? Do you just want to have it lurking in a hidden  
 span and show it after a click? What does your basic page look like,  
 and how much detail do you want to show?

 Walter

 On May 23, 2009, at 5:34 PM, jef wrote:



  Hi there

  I'am looking for a nice script, on top of prototype,  that can do that
  in a sexy way.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: script a licious slider update with effect scrollto

2009-05-26 Thread ColinFine



On May 25, 1:46 pm, bambam007 spleensm...@optusnet.com.au wrote:
 I am using the slider and mouse scroll to scroll inside a div
 Now i want to add anchor button. so when i click the button, the
 specified div scrolls to the ID. and the slider updates accordingly.
 You can see my code 
 athttp://www.codingforums.com/showthread.php?p=820484#post820484

 with this I can scroll, but it scrolls the whole page as well as the
 div. And the slider does not update.

 I have been working on it with the below code but nothing happens
 a href=# onclick=$(table_scripts).Effect.ScrollTo('7',{ duration:
 16 }); return false;Click me to/a

 table_scripts is the name of the containing div with the scroll.

 Please help

That's not the right syntax for Effects. Effect is a constructor, not
a method of Element. You need

new Effect.ScrollTo('table_scripts', ...

Also, I strongly recommend you don't use the DOM0 method ('onclick')
but instead use

a href=# id = 'scrollme'
...
(somewhere inside a script tag)
$('scrollme').observe('click', function() {new Effect.ScrollTo
('table_scripts', ...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: evalScripts and functions

2009-05-26 Thread ColinFine



On May 26, 12:41 pm, david david.brill...@gmail.com wrote:

 @ColinFine,

  According to Flanagan's book (section 8.1.2) the optional function-
  name in a function literal is not assigned to a variable, but
  apparently lives in a special namespace of its own that allows the
  function to refer to itself. So unless the function is recursive, the
  above is identical to

  var myFunction = function() {alert('hi');}

  and more or less identical to

  function myFunction() {alert('hi')}

 I try to refer to myFunction recursivelly and in both case it works
 (test done on FF3.0).
 could you send me an exemple of what you say ?

No I can't. I'm just quoting from the books.

 I'd only though the difference was in the scope of the created
 function depending on the way it is declare as a *statement* or as a
 *litteral*.

I didn't go into the reasons why Crockford advises not using function
statements. They are:
- the second form makes it clear that [myFunction] is a variable
containing a function value. To use the language well, it is important
to understand that functions are values
- function statmenes are subject to 'hoisting'. This means that
regardless of where a function is placed, it is moved to the top of
the scope in which it is defined. ... It also prohibits the use of
function statements in if statements. ... 

It doesn't seem to me that these imply that there will be a different
scope, but I'm not sure.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: How can I get a list of events fired by an object?

2009-05-26 Thread Matt Foster

I'm pretty sure you can listen to the iframe's load event for that...
I don't think it bubbles so you'll have to listen to it on the iframe
itself and not on a parent.

I use that event extensively in my ajax history solution,
http://positionabsolute.net/blog/2007/07/javascript-history-service.php

--

http://positionabsolute.net

On May 21, 5:39 pm, Walter Lee Davis wa...@wdstudio.com wrote:
 Thanks, it appears that the only way that I'll be able to work around  
 this is with a timed observer pattern, there doesn't seem to be an  
 event fired by an iframe into the page context when its src changes.  
 The underlying problem was how to keep an iframe sized to match its  
 contents. While you get one onload event when the frame finishes  
 loading, no others are ever fired, even when you navigate to a  
 different page within the iframe.

 Walter

 On May 21, 2009, at 5:05 PM, Matt Foster wrote:

  You could find a list of all events and listen to them each, there
  isn't an all operator to listen to any event that is fired as far as
  I know...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: observer ignored for submit buttons in IE 6?

2009-05-26 Thread ykaerflila

sorry its taken me so long to get back in here and reply but I've been
fighting with my own ignorance heh.   I got so caught up in the
initial problem in here I forgot details about the extra logic I
needed, to do exactly what I want when the buttons are clicked.

I am disabling each and every input button on the page when one is
clicked.  When i added this code it was stopping the form from
submitting ( in ie6) it just took waisting several hours scratching me
head to remember that disabling submit buttons on click stops form
submission in IE(not sure about newer IE versions but it does this in
6). Initally i was just using alert(clicked); to troubleshoot
problem.  The actual code w/ logic now looks like

document.observe('click',function(evt){
  var elm = evt.element();
  if (elm.tagName == 'A' ){
if (elm.getAttribute('href') != #){
  $('processing_gif').show()
};
  }else if( elm.getAttribute(type) == 'submit' ){
$('processing_gif').show();
$$('input[type=submit]').invoke('disable');
elm.up('form').submit();
  }
} );

as you can see I'm handling the buttons and anchors differently.
Anchors are simply showing the animated spinner. while buttons show
the spinner and disable the rest of the buttons on that page. the
current problem is elm.up('form').submit(); is failing.  I discovered
it is because when these pages were initially written the input
buttons  have the type, value, and, name all set to submit.  which is
bombing submit().  If I change the name of the submit buttons
everything functions correctly.  Which leads me to the question.  Is
there a way for submit() to function with input name=submit
type=submit /  because that is so ingrained into the html and back
end code that if I cannot I need to re approach a different way in
javascript.

Thanks again for all of your help.

On May 23, 2:59 am, T.J. Crowder t...@crowdersoftware.com wrote:
 Hi,

  This does bring into question in my mind the order of onclick vs.
  forum submission.  right now the 2 buttons i've been testing this with

 FWIW, I think the question you have to ask is why you're seeing this
 behavior but I'm not, and moreover, I haven't heard of it either --
 this suggests there's something very strange going on specific to your
 page.  At first I thought it was form submission too, but a quick
 check with IE6 showed that I got the alert before the form was
 submitted.  Here's the page I was testing with.[1]  As shown there, it
 will alert and then submit the form to blank.html, but there's some
 commented-out code to prevent the form submission.  Either way, I got
 the click alert.

 [1]http://pastie.org/487167

 HTH,
 --
 T.J. Crowder
 tj / crowder software / com
 Independent Software Engineer, consulting services available

 On May 22, 5:29 pm, ykaerflila ykaerfl...@gmail.com wrote:

  well its not a version issue. I just copied the js files from to
  another to confirm and the issue still persists with dom:loaded

  as far as timing goes the submit buttons I'm observing for clicks are
  static HTML elements.  I had been assuming all static HTML is loaded
  upon dom:load (but admittedly I've never looked to confirm that it
  just seem to make sense =)

  This does bring into question in my mind the order of onclick vs.
  forum submission.  right now the 2 buttons i've been testing this with
  submit a form when clicked.  In FF I see the alert window telling me
  the 'click' observer is firing off before the form is getting
  submitted.  in IE6 I see nothing so is there a possibility that the
  form is actually getting submitted before the 'click' observer fires
  off?

  Then again maybe I'm going about all of this the wrong way.  what I'm
  shooting for here is to show a loading spinner on the page on each
  click of links and selected input buttons.  hence the $$
  ('a','.processing'). The site I'm working on has some AJAX and each
  AJAX request shows/hides a processing spinner. some of the bigger page
  requests and during peak times users are multi clicking buttons
  because they are looking for the AJAX processing spinner(even on non
  ajax requests) rather than watching the IE window and thinking nothing
  is going on.  so what i sat out to do was simply show the processing
  spinner via each click of an anchor tag or button which has
  the .processing class attached to it.  all it needs to do is .show()
  the spinner div onclick but i'd rather not have to go through each
  link and button to add onclick=$('spinner').show().  IE 6 is
  important because this runs in XPe terminals which of course are all
  running IE6 =)

  On May 22, 9:53 am, Walter Lee Davis wa...@wdstudio.com wrote:

   You may find that you are using the same version on both sites, which
   means that my solution fixed the problem, but not for the reason I
   thought.

   There may be a timing/latency issue somewhere else in your code that
   is resolved by the DOM being completely settled (onload is very late
   in the game, the 

[Proto-Scripty] Re: Droppable double click and onUpdate problem in firefox and ie

2009-05-26 Thread terry-5-

Hi Walter,

Thank you so much. You were right on the dot. I used Firebug and found
out that one of the innerHTML child elements I was referencing in my
javascript file did not exist and FF was throwing errors. That was it.
I changed the code and the double clicking is no more and the onUpdate
works like a charm.

Only thing remaining: I wanted the boxes only to hold one word at a
time. The users would have to empty the box before they could replace
it with another word. Do you know if I have to integrate that with the
onUpdate functions?

Thanks again.

terry
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: How can I get a list of events fired by an object?

2009-05-26 Thread Walter Lee Davis

This works fine as long as the iframe stays in the current domain. If  
it strays outside that, you get a permission error. The person who was  
after this wanted an iframe that would expand to hold its contents  
without hiding any of them or displaying scroll bars (not sure why,  
exactly). I've warned them about this issue, and thanks again for your  
help.

Walter

On May 26, 2009, at 1:14 PM, Matt Foster wrote:

 I'm pretty sure you can listen to the iframe's load event for that...
 I don't think it bubbles so you'll have to listen to it on the iframe
 itself and not on a parent.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Auto submit drag drop form?

2009-05-26 Thread Maya

How can you auto submit the form each time a record is dragged/dropped
without using a submit button?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] slider problem - prototype to blame?

2009-05-26 Thread geoffcox

Hello,

The slider at the bottom of this page,

http://www.aldenta.com/examples/script.aculo.us/slider-standard.html

is not in the centre as it should be.

I have been told that prototype.js is to blame os this so?!

Cheers,

Geoff
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Auto submit drag drop form?

2009-05-26 Thread Walter Lee Davis

Are you talking about a Scriptaculous Sortable here? There's an  
onChange() function that can do what you are talking about in that case.

Walter

On May 26, 2009, at 12:30 PM, Maya wrote:

 How can you auto submit the form each time a record is dragged/dropped
 without using a submit button?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Queue is slow

2009-05-26 Thread austenc

I'm trying to queue blindup and blinddown effects so the user can't
double click to break things.

I've tried adding this to my js file:

 Effect.Queues.get('myQueue').interval = 100;

The queue itself is working... but takes a long time when  you first
click on an item to actually fire the Effect. at least  a few seconds.
How do I make this queue work at normal (almost instant) speed?

I've tried adding the line above to the functions that deal with
blindup and blinddown... it didn't do anything.

Thanks

austen

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Effect.complete event listener or equivalent?

2009-05-26 Thread austenc

Hi there, I've got an accordian style toggle script going, but i just
found a bug. if you click one of the links again right after clicking
it (while the Effect is still going), it makes the division disappear,
or close.

It's happening because my script is trying to start an Effect before
the first effect is finished.

So, my question is... is there a way to tell if no Effects are
currently going?

something like:

if(!Effects.going){
//try to run other effect here.
}

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Controlling speed of scrolling

2009-05-26 Thread edb

Hi guys,

You'll have to forgive me as I'm more of a designer by nature but as
part of this utilised a bit of prototype javascript and upon being
asked to change a variable 6 months down the line, am a bit stuck.

It's code somebody else has created called the news scroller and
basically it scrolls content in a layer. Nothing exciting, I just
can't see any speed control variables and was wondering if there's an
easy way to get one in there. The prototype library it is currently
using is 1.5, but I can update it if needs be.

The code is as follows.

script language=javascript
var boxHeight = $('news').style.height.replace('px','')
var repeatHeight = $('news').scrollHeight //get the
current height so we know when to wrap
$('news').innerHTML = $('news').innerHTML + $
('news').innerHTML  //add a second copy so we can scroll down to the
wrap point
var stopScroll = 0
var x
function scrollMe() {
clearTimeout(x)
if(stopScroll==1) {
return
}
$('news').scrollTop=$('news').scrollTop+1
if($('news').scrollTop=repeatHeight) {
// keep on scrolin'
x = setTimeout(scrollMe(),40)
}
else { //we have hit the wrap point
$('news').scrollTop=0
x = setTimeout(scrollMe(),40)
}
}
x = setTimeout(scrollMe(),3000)
// start scrolling after one second
/script


Thanks in advance, hopefully you can offer some assistance,
Ed Barton

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---