Displaying 20 results from an estimated 1000 matches similar to: "this pointer in Event.observe function"
2005 Dec 29
2
Ajax.Request: onLoading executed after onComplete in IE
Hi,
i''m trying to use a visual indicator for my Ajax requests. It''s based on the
shopping cart demo at script.aculo.us and works great in Firefox, Konqueror
and Opera, but fails in IE6. For some reason (timing problems?) onComplete is
executed before onLoading, so the indicator is shown but not hidden when the
request has finished.
Oddly enough it works fine in the shopping
2006 Jan 20
5
Height problem after interrupting SlideDown/SlideUp effects
Hi,
i have a problem with the the SlideDown and SlideUp effects. Since a similiar
problem is also visible on the script.aculo.us homepage, i''m going to explain
it this way.
- Go to http://script.aculo.us/
- On the main site below "visual effects", click "Advanced options", the sub
panel will scroll down.
- Hit the close button, and while the panel is still
2006 Feb 09
3
Draggables and Droppable performance (tips)
Hi all. I have some performance tips to share. I had been having
problems with the overall performance of the drag/drop objects. This is
due largely to the fact that my project really pushes the limits
(potentially thousands of draggables and hundreds of droppables in the
document at a time, although that is the extreme case).
Something I discovered is that the performance of dragging goes WAY
2006 Jun 15
3
RE: Yahoo!-like Eventobjectemulation/abstractioninPrototype?
This is obviously rough draft and not thoroughly tested, but it seems to
work. If you''d like, give it a try (load it after you load
prototype.js):
Function.prototype.bindAsEventListener = function(object) {
var __method = this;
return function(event) {
return __method.call(object, new SuperEvent(event || window.event));
}
}
var SuperEvent = Class.create();
2006 Mar 04
1
RE: Question about event listener highlighting withchild elements
1. Create a separate class that has your highlight/unhighlight behavior
in it, and extend just the element you want to highlight with that
class... like this (also allows you to easily apply this behavior
elsewhere when you need it in the future):
Object.extend(this.el, HighlightBehaviorClass.prototype)
2. When defining your event handlers, assign them to variables so you
have a
2006 May 25
7
Hide content before page load
Hi,
i''ve been experimentating with dynamicCSS.js [1] to hide content only if
JavaScript is enabled. It works pretty well and fires before onload to avoid
the flash of visible content. Now i''m wondering if there is a Prototype way
of doing this.
[1] http://www.bobbyvandersluis.com/articles/dynamicCSS.php
My main problem is that Prototype functions like Element.toggle() do
2006 May 28
13
JSON not auto-evaluated
Hi,
please consider this stripped down example:
new Ajax.Request(''foo.php'', {
onSuccess: function(t, json) {
alert(json.myParam);
}
});
According to http://www.sergiopereira.com/articles/prototype.js.html, the
second param is supposed to be the evaluated json object IF the X-JSON header
is send in the response. I send the header in my script. However, the json
var
2005 Dec 22
0
RE: Re: ajax - multiple updates on singlexmlhttprequest
>From looking at the Prototype code, it looks like any text in the
''X-JSON'' header will be eval''d and passed as the second parameter to
your onSuccess handler.
Your handler function could then be (using all the power of Prototype):
var handlerFunc = function(t, json)
{
// Update info container
Element.update(''someId'', json.foo);
}
But your
2003 Mar 09
1
Please help me!!
Dear Ogg Vorbis,
I'm a senior in Information Technology, and my thesis is on Audio Watermarking. As a new starter in audio, I really need your help, and suggestions. I think in order to persue something on Audio I have to know much details about audio formats. So could you please show me where I can find the documents about the information I need ? Finally,could you please answer a confused
2006 Jun 07
6
What if $$() for?
In the prototype.js library, what doe the $$ function do, and how do you
use it
--Will Merrell
2006 Apr 30
1
Draggable - how start action on start dragging and end action on droppping
Hi all. I have got situation that I made element draggable - and
when element is dragged I want to start some action (e.g. shown
AJAX indicator, and change one of CSS class in dragging element).
What is the best way to achieve this? I search source code of the
Draggable and I saw that there is 2 method: Draggable.initDrag
and Draggable.endDrag so it looks like in initDrag method i
should
2006 Feb 27
3
bindAsEventListener with parameters
I would like to share a modification to bindAsEventListener() that
might be useful to some of you. It makes it possible to do
function show(event, number) {
alert(Event.element(event).id + " = " + number);
}
Event.observe("el1", "click", show.bindAsEventListener(this, 5);
Event.observe("el2", "click", show.bindAsEventListener(this, 10);
That
2012 May 22
1
Capturing signals from within external libs
I have a continuous loop running in an external library that I am calling
from C (R API). This loop is processing events in real time with the
possibility of significant lag between events.
When processing an event, I can make use of R_CheckUserInterrupt, but
while the external library code is waiting on a new event, I don't have an
opportunity to call this - my entry points are only on
2006 Jun 16
11
Detecting Body Onload
I have a piece of code that "waits" for body onload. Every 30ms, it tests
$(''body'').
Seems that isn''t always good enough. I''ve hit situations where the DOM is
"partially" loaded somehow.
I fixed matters by setting a global flag...
<body onload="bodyLoaded=true;">
which provides a better test... of course I could
2006 Mar 04
0
Question about event listener highlighting with child elements
I have created a JavaScript object which is initialized for some input
fields, fieldsets, and divs on the page. With each object i attach a
mouseover and mouseout event that highlights and un-highlights. Also on
mouseout i am trying to display the id of the object to a console. The
highlighting works except for cases when an object is the child of another
object. In this case both are highlighted
2006 Mar 03
11
event.keyCode broken in prototype?
I ran 2 tests. One using proto''s Event.observe, and another using an
in-line handler of the "keydown" event in a textbox.
Using .bindAsEventListener, the event.keyCode is always returning a
capital letter, no matter what. The in-line event handler returns
lowercase vs. uppercase correctly... What''s going on?
I guess I find it hard to believe no one has tried
2006 Jun 19
2
Autocompleter enhancement feature request
Hello,
I have created a ticket for an enhancement of the autocompleter to show the
options immediately when the field gets focus. Right now at least one
character must be typed for autocomplete to kick in.
http://dev.rubyonrails.org/ticket/5435
I have also made some code changes directly in the script
Event.observe(this.element, "blur", this.onBlur.bindAsEventListener(this));
2006 Feb 06
2
ROR Production issue
Currently I am not getting much traffic on my site, when I visit my site
after a long interval I get the dreaded "Rails application error" in
Mozilla/ "Internal server error" in IE.Once I click refresh then the site
comes to life. My guess is this is due to the fact that all FCGI process
have died and there are no active listeners.
Has anyone else experienced this issue. How
2006 Jun 15
10
RE: Yahoo!-like Event object emulation/abstractioninPrototype?
If that doesn''t work, then you''ve done something wrong somewhere.
''Cause it works for IE for me and everyone else.
The only advantage I see with the YUI toolkit is that it''ll defer
attaching events to elements that do not yet exist in the DOM. Big
whoop, only a sloppy programmer would try to attach an event to a
non-existant element. With Prototype, you can
2006 Feb 10
13
Element.observe () binding
Hey all,
I working on a project, but I am not sure I can do what I want to
do. The following works beautifully:
Event.observe(el, ''click'', function () { this.className += "
myClass"; return false; });
I have also tried doing this:
this.varname = ''test'';
Event.observe(el, ''click'', function () { alert (this.varname); }.bind