Skip to main content

All Questions

Tagged with
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) { ...
sv_in's user avatar
  • 14k
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 ...
Slava's user avatar
  • 3,037
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... ...
Micha's user avatar
  • 53
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 = ...
Federinik's user avatar
  • 522
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 ...
acoder's user avatar
  • 523
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. ...
eXtenZy's user avatar
  • 67
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 ...
Alex's user avatar
  • 10.1k
2 votes
2 answers
76 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,...
Julian H. Lam's user avatar
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(); ...
XTRUST.ORG's user avatar
  • 3,374
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!
Donovant's user avatar
  • 3,151
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);
Algorithm's user avatar
  • 329
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) {...
fraxture's user avatar
  • 5,414
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 == '...
Torsten's user avatar
  • 91
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-...
maryisdead's user avatar
  • 1,810
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);
Itay Moav -Malimovka's user avatar
1 vote
3 answers
3k views

Event removal in Mootools, and syntax of event addition

So I have been adding my events thusly: element.addEvent('click', function() { alert('foobar'); }); However, when attempting to remove said event, this syntactically identical code (with "add" ...
Julian H. Lam's user avatar
1 vote
1 answer
115 views

Mootools Add click event with Drag.Cart

I use this example under jsfiddle.net, to build a drag&drop system and if I create a click event on shirts images (draggables), this event doesn't work. How to combine drag and click events to ...
Kevin Campion's user avatar
1 vote
1 answer
194 views

MooTools – Add class to page on click of anchor, with delayed loading of anchor link

I'm using MooTools to add two classes to the body on click of a link from a nav menu, which triggers an animated CSS fade of the page. I want to delay the link from loading the new page until the ...
jasonbradberry's user avatar
1 vote
3 answers
1k views

Why can't I set my input field with MooTools?

Ive got a document and when the user enters something into one input I need to show a response in a second input box. I can get the user given value, i can process it, but when I try to set the second ...
JeremyS's user avatar
  • 329
1 vote
3 answers
325 views

Avoid anonymous function in Mootools?

Here's my problem: I'm looking for a way to work with 'not anonymous' function in Mootools. Can't find a way to work it out, and I couldn't find doc about it. Example: var myInput = new Element('...
Smithfield's user avatar
1 vote
1 answer
5k views

Mootools doesn't fire the "onChange" event for Selects in IE7

I'm working with MooTools 1.2.4 and I have a select with an event "change" that works fine in Firefox but when I try to test it in Internet Explorer 7 it gives me an error saying that the ...
pleasedontbelong's user avatar
1 vote
2 answers
600 views

Dom Element onclick (MooTools :: optionally)

Consider the following example: function async_callback(array1, array2, array3) { // All arrays are equal length for(var i = 0; i < array1.length; i++) { var myElement = new Element('div',...
Theofanis Pantelides's user avatar
1 vote
1 answer
149 views

how to define a private event [Port Mootools to jquery]

I'am a big mootools fan. But now I have to port a mootools-snipe to jquery and I do not get it. I' am using this code: var prev_m_x = 0; var prev_m_y = 0; window.addEvent('mousemove',function(e){...
hamburger's user avatar
  • 1,415
1 vote
2 answers
820 views

Mootools: how to stop delay events with 'mouseenter' and 'mouseleave'

I'm quite a newbie with javascript and mootols and I've got a question about delay and event handling with Mootools. My goal: the menu appears in a primary position, then after a certain time moves ...
user1236174's user avatar
1 vote
1 answer
675 views

Mootools: how to stop event, when other event happens

i´ve got a question about mootools eventhandling. I wanna delay a mouseenter event for a dropdown navigation. After 1 second the drowdown list will be shown by "setStyle('display', 'block')...this ...
Micha's user avatar
  • 11
1 vote
1 answer
49 views

javascript/mootools | Custom events

I have 1-st script: <script> App.validate(helper, form, "", // Simple request to the server function(data) { if (data.products_in_cart) { ... I dont't know how to ...
XTRUST.ORG's user avatar
  • 3,374
1 vote
1 answer
68 views

Mootools class: call a class method from an event handler

is it possible to call a class method from within an event handler? I mean, something like this: initialize: function(options) { /* initial options */ this.setOptions(options); this.area =...
gabric's user avatar
  • 1,955
1 vote
2 answers
500 views

map keyboard keys with mootools

I am looking to make the enter key behave exactly like the tab key on a form. I am stuck on the fireEvent section. var inputs = $$('input, textarea'); $each(inputs,function(el,i) { el....
Adriaan Nel's user avatar
1 vote
1 answer
1k views

Javascript Mootools event stop

well,i have this script that i have set up that on submit requests php file that is used to validate my input values...i have set up that when it is not validated the correct way to echo it is not ...
Shile's user avatar
  • 1,063
1 vote
2 answers
96 views

How do you access an object instance in the second parameter of the Mootools fireEvent function?

I'm working through Implements: [Events, Options] in Mootools. I would like to pass a class property to the function that is called when an event fires. I would have thought that I could do it using ...
Rupert's user avatar
  • 1,629

15 30 50 per page