All Questions
66
questions
0
votes
1
answer
36
views
mootools Class overload
I cannot overload class function
var Input_text = new Class({
initialize: function(obj, defo){
that = this;
if (obj) {
this.elem = obj;
this.elem.addEvent('keyup', function(...
0
votes
2
answers
702
views
Event click trigged twice though preventdefault is set
Some had this problem but I did not see any answer that fits mine.
Here is the html :
<div id="page">
......
<ul>
<li role="presentation">
<a id="selection"...... &...
0
votes
0
answers
78
views
How to add event keydown in mootools
Please, help me!
This is my code:
this.rez[str].each(
function(v){
var li = new Element('li', {
'html': v[1],
...
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
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 ...
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) {...
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 ...
2
votes
1
answer
606
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(); ...
0
votes
1
answer
61
views
Reference an accordion instance in Mootools
I'm using a CMS (Joomla 3) to show an accordion. Beyond the default functionality, I wish to put a button on each pane of the accordion to step to the next pane. Normally this would be done at the ...
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 ...
1
vote
1
answer
496
views
Mootools overriding window scroll
I know this is a bad idea but it's what the client has asked for so....
i'm using mootools to override the window mouse wheel scroll event, so basically when the user scrolls the wheel i'm preventing ...
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 =...
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 ...
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 ...
3
votes
1
answer
432
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 = ...
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....
0
votes
1
answer
238
views
Why is event in Firefox undefined when defining a pseudo event with MooTools?
I am trying to define a pseudo event with MooTools. It works in Chromium, but not in Firefox. Both browser are the newest stable version.
Here is my event:
DOMEvent.definePseudo('ctrl', function(...
0
votes
1
answer
344
views
mootools validate and submit form on link click
How can I validate my form and submit it on link click event? My code below:
new Element('a',{
'html': "To cart",
'class': 'shop_add',
...
0
votes
1
answer
155
views
Mootools. New element with events in loop
I can't find the problem. May be you can help me:
load_images: function(config, container, page) {
console.log(page) // Every time page = 4 Why?
var paging = new Element('div','class':'pg'})....
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){...
1
vote
1
answer
210
views
MooTools: How do I make an object capture a custom event occured in its nested object?
Here's the simplified code:
<html>
<head>
<script type="text/javascript">
var ParentDiv = new Class ({
initialize : function(htmlElement) {
...
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 ...
0
votes
1
answer
109
views
Mootools Lightbox with Img Slider
I use the Mootools Mediabox for my Site.
This one mediaboxAdvanced v1.4.6.
Now i looking for a solution that the image change automatically afer 5 Sec.
In the code i found thie
{id:"mbNextLink",href:...
0
votes
1
answer
259
views
scope of 'this' inside mootools class
I'm trying to define a click handler in a Mootools class. My handler presumes opening a block of links, each of which should be 'equipped' with its own click handler, which should trigger a link ...
0
votes
2
answers
200
views
run mootools function on each element except the one
I have two maps:
var map1 = document.id('map1');
var map2 = document.id('map2');
The second map is hidden.
map2.setStyle('display','none');
On the first map there is an element (link) that has an ...
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. ...
0
votes
2
answers
483
views
Triggering JSON request from 'click' event in a selector box using Mootools
Im trying to trigger an asynchronous JSON request when I select an option from an HTML selector box using mootools.
I have the following form element:
<form method="post" id="sel">
<select ...
1
vote
1
answer
251
views
bindWithEvent error while converting mooRainbow to mootools 1.4.4
I'm trying to get mooRainbow 1.2b ( http://moorainbow.woolly-sheep.net/ ) working with mootools 1.4.4 and I've run into an error that I can't seem to find an answer for.
The error is thrown in this ...
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!
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 ...
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 ...
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,...
1
vote
1
answer
553
views
mootools disable or intercept an added event
let's say i do this:
$('field').addEvents ({
'focus' : function() { // do some stuff }
'blur' : function() { // do other stuff }
});
this is the default behaviour for all my text input fields. ...
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 ...
0
votes
1
answer
163
views
Where does Event.Keys gone?
Did I miss something or the Event.Keys object has gone from mootools since 1.4.0 ?
I cannot get the real value of a key or compare it to the current pressed key :
var modifiers = {
previous: ...
0
votes
2
answers
541
views
Handling Mouse Events Behind An Element
I'm implementing a drag and drop interface using Mootools, where a ghost copy of the dragged element is created and moves around with the mouse. I want the user to be able to use the mousewheel to ...
0
votes
1
answer
373
views
Dynamic change of the class of an HTML element not working effectively
I've written an HTML page that contains a form. The form is checked by a PHP page by having at the beginning of the HTML page :
<script type="text/javascript" src="js/mootools/core.js"></...
2
votes
2
answers
482
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);
0
votes
1
answer
467
views
Mootools -- call class function from bound css class results in 'not a function' error
Using Mootools 1.3.2
Code is as follows:
var DNReportAbuse = new Class({
Extends: DNUserDialog,
comment_id: null,
container: null,
initialize: function(classname)
{
var bindclass = $(document....
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
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 ...
0
votes
2
answers
1k
views
Attaching Events To Classes In MooTools?
I am fairly new to MooTools and I'm just a little confused about how to use it and would like a few pointers.
For example, in my app, when an object of one of my classes is initialized, it creates a ...
0
votes
2
answers
4k
views
submit a form with mooTools, and have the forms inline onsubmit event fire...help
Im writing a class that replaces all input type="button" and input type="submit" in the document with a custom button, that is actually a span stuffed inside of an anchor tag, i've got everything ...
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...
...
0
votes
3
answers
1k
views
Javascript double event firing unwanted
I want to perfom the same action for 2 different events firing. The problem I have is that one of the event fire the other. I'm using javascript and Mootools, also events are set on an 'input' element,...
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('...
0
votes
3
answers
1k
views
How to trigger event on dynamically generated elements (in mootools)
Example to demonstrate the issue can be found here:
http://jsfiddle.net/Byyu2/
As you can see only the first "Add" button triggers an event. The dynamically generated button does not. This is ...
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" ...
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 ...
0
votes
1
answer
125
views
Can someone explain jQuery's addEvents feature?
I saw this code on someone else's website, but found no reference to it on jQuery's site.
window.addEvents({
'domready': resizer,
'resize': resizer
});
Can either: someone point me to the ...