All Questions
66
questions
208
votes
11
answers
216k
views
event.preventDefault() function not working in IE
Following is my JavaScript (mootools) code:
$('orderNowForm').addEvent('submit', function (event) {
event.preventDefault();
allFilled = false;
$$(".required").each(function (inp) {
...
7
votes
1
answer
6k
views
How to implement OnDestroy/OnDispose event in JS/Mootools?
Is there any existing OnDestroy/OnDispose event in JavaScript or are there any known custom implementations in plain JS or Mootools? Let's say I want to call console.log('bye') when an element gets ...
5
votes
1
answer
4k
views
Mootools: inject vs adopt
I want to dynamically add some preconfigured HTML-Elements in use of a 'click'-event with mootools.
So I can make it work with my basic knowledge, although it isn´t very nifty. I coded this so far...
...
3
votes
1
answer
433
views
Access class attribute in event handler in js-mootools
I have a JS object (working with mootools) wich has stored some DOM elements and attach to them event listeners:
window.myObject = {
init: function(el1ID, el2ID){
this.myElement1 = ...
3
votes
2
answers
1k
views
MooTools event listener disappears after element.innerHTML is changed
I am trying to achieve this task using MooTools.
Description:
I attached an event listener to myButton link. A click on this link initiates an AJAX request and updates myDiv content based on the ...
3
votes
1
answer
1k
views
How to determine error code on broken images with mootools
I need a script that can determine the reason an image didn't load based on the HTTP status code supplied.
I am aware of the onError event on images and objects, but it does not pass the error code. ...
2
votes
1
answer
373
views
In jQuery how to fire an elements event added in mootools?
I have a MooTools script (please dont ask why..) where elements are added a mouseenter event. In jQuery, I open/show those elements within a fancybox. When it pops up, the mouseenter event wont get ...
2
votes
2
answers
77
views
How to define an event that changes an element that has a different event?
Apologies for the vague title, it's kind of hard to explain in a line...
In any case, let's say I have a button with an action as defined by the data-action property. When the user clicks said button,...
2
votes
1
answer
608
views
mootools | Open/close popup menu and outer click event
I'm using mootools and working on popup menu:
document.getElement('.cart a').toggle(
function() {
this.getParent('div').removeClass('open');
this.getNext('.cart_contents').hide(); ...
2
votes
1
answer
780
views
Mootools: how fired a function (or more functions) after the end of a tween or morph FX or other event?
as title, I would to knoe how can I do to fired a function after the end of an event.
Thanks!
2
votes
2
answers
483
views
Event binding in MooTools like jQuery
Is there a way to assign a multiple event types in MooTools like jQuery?
Mootools:
$$('#id').addEvents({
keyup: fn,
click: fn
});
jQuery:
$('#id).bind('keyup click' ,fn);
2
votes
1
answer
1k
views
No Event object on Scroll Event in MooTools?
I am getting an undefined value for the event object that I think should be available in the callback for the addEvent() function. This is what I'm doing.
element.addEvent('scroll', callback(event) {...
2
votes
1
answer
83
views
how to control the back button with mootools?
This is how it looks for jQuery.
How can I achieve the same thing with Mootools?
$(window).on("navigate", function (event, data) {
var direction = data.state.direction;
if (direction == '...
1
vote
2
answers
1k
views
JavaScript event.target only reports child (MooTools)
I seem to get something fundamentally wrong. I have this HTML
<div id="thumbnails">
<a href="#image-0">
<img src="blabla-1.jpg" />
</a>
<a href="#image-...
1
vote
3
answers
2k
views
how to attach onclick event to an array of elements (mootools)
Is there a syntax for the following thing:
$$('.a-lot-of-elems').addEvent('someevent',somefunction);