Questions tagged [mootools]

MooTools is a compact, modular, object-oriented prototypal JavaScript framework designed for the intermediate to advanced JavaScript developer. It allows you to write powerful, flexible, and cross-browser code with its elegant, well documented, and coherent API.

MooTools is a compact, modular, object-oriented JavaScript framework designed for the intermediate to advanced JavaScript developer. It allows you to write powerful, flexible, and cross-browser code with its elegant, well documented, and coherent API.


Hello World Example

window.addEvent('domready', function(){
    document.getElements('a').addEvent('click', function(event){
        event.stop();
        console.log('hello world from link with href ' + this.get('href'));
    });
});

Questions Tagged with

When asking a question:

  1. Consult the MooTools API documentation and search Stack Overflow for similar questions already answered before asking a question.
  2. Isolate the problematic code and reproduce it in an online environment such as jsFiddle or JS Bin. If applicable, include a link to the fiddle or online environment in your question. Always include the problematic code in your question.
  3. Tag your question with a MooTools version. The available tags are
    , , and .
    If a tag for your MooTools version does not exist, mention it in your question. See the "Version Information" section below for more information.
  4. If your question deals with any of the following aspects of MooTools, include the corresponding tag:
  5. Tag the question with other web-development tags if applicable
    (e.g., , , , etc.).
  6. Mention the browser(s) and browser version(s) where the problem occurs. If the browser or browser version is an important aspect of the question, include it as a tag
    (e.g., , , , etc.).

MooTools for Beginners

If you are just starting with MooTools, then you should read the following guides:


Version Information

The current version is MooTools 1.6.0 released Jan 14th, 2016. This is a maintenance / bug fix release.

For specific information about a particular MooTools version, see the tag wiki for that version or read the release notes on the official blog.

List of major stable MooTools Versions


MooTools Resources

Online Resources

MooTools Extensions / Utilities

  • Moobile - a new mobile application framework launched in April 2012 that is similar to jQuery Mobile in terms of the functionality it affords
  • Epitome - a MVC/MVP framework for MooTools 1.4.5+
  • MooDocu - a browser-based, client-side MooTools documentation parser with search; it works off-line through localStorage

MooTools Books

2586 questions
526
votes
28 answers

Comparing date part only without comparing time in JavaScript

What is wrong with the code below? Maybe it would be simpler to just compare date and not time. I am not sure how to do this either, and I searched, but I couldn't find my exact problem. BTW, when I display the two dates in an alert, they show as…
moleculezz
  • 7,513
  • 4
  • 25
  • 25
249
votes
27 answers

Uncaught SyntaxError: Unexpected token :

I am running an AJAX call in my MooTools script, this works fine in Firefox but in Chrome I am getting a Uncaught SyntaxError: Unexpected token : error, I cannot determine why. Commenting out code to determine where the bad code is yields nothing, I…
trobrock
  • 46,549
  • 11
  • 40
  • 46
207
votes
11 answers

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) { if (inp.getValue() != '') { …
sv_in
  • 13,929
  • 9
  • 34
  • 55
88
votes
3 answers

Simplest way of getting the number of decimals in a number in JavaScript

Is there a better way of figuring out the number of decimals on a number than in my example? var nbr = 37.435.45; var decimals = (nbr!=Math.floor(nbr))?(nbr.toString()).split('.')[1].length:0; By better I mean faster to execute and/or using a…
PhilTrep
  • 1,521
  • 1
  • 10
  • 23
86
votes
2 answers

CSS selector for targeting only immediate children and not other identical descendants

I have a nested sortable list that can have items dynamically added or removed and can be nested n-levels deep. On nesting, a new ul element is injected into whatever li element is selected to be the parent. The initial state of the list is…
VirtuosiMedia
  • 52,016
  • 21
  • 93
  • 140
84
votes
8 answers

preg_match in JavaScript?

Is it possible in JavaScript to do something like preg_match does in PHP ? I would like to be able to get two numbers from string: var text = 'price[5][68]'; into two separated variables: var productId = 5; var shopId = 68; Edit: I also use…
hsz
  • 148,279
  • 62
  • 259
  • 315
72
votes
20 answers

Why is jQuery so widely adopted versus other Javascript frameworks?

I manage a group of programmers. I do value my employees opinion but lately we've been divided as to which framework to use on web projects. I personally favor MooTools, but some of my team seems to want to migrate to jQuery because it is more…
Andrew Moore
  • 93,497
  • 30
  • 163
  • 175
61
votes
5 answers

Cross domain iframe issue

For say i have a Site called example.com on which iframe is embedded of domain iframe.net, now i want to read the content of iframe and pass some parameter to display a textual message. Like Hi with username. Now the problem is this able not able…
Kunal Vashist
  • 2,380
  • 6
  • 30
  • 59
45
votes
2 answers

What is jQuery (edge) in jsfiddle.net?

In jsfiddle.net if one choose framework as jQuery or Mootools they will get an option for choosing jQuery ( edge ) and Mootools( edge ). I googled it quite a bit but did not get any good answers. My questions are What are those versions? How are…
naveen
  • 53,448
  • 46
  • 161
  • 251
45
votes
6 answers

How to capture touchend coordinates?

I am trying to capture touch coordinate on the touchend event but get undefined. The touchstart event works good, but same concept fails on touchend. I built this code with mousedown and mouseup and that works good. What am I…
Rikard
  • 7,485
  • 11
  • 55
  • 92
42
votes
4 answers

Retrieve width/height of a css3 scaled element

I'm fighting against an oddity (I think) of the offsetWidth property. this is the scenario: I've got, let's say, a span tag, in my js, at a certain point I perform a css3 transform to this element, like: el.set('styles', { …
holographix
  • 2,497
  • 2
  • 32
  • 46
41
votes
5 answers

How well does jQuery support backward compatibility?

We have had issues with Mootools not being very backward compatible specifically in the area of drag and drop functionality. I was wondering if anyone has had any similar problems with jQuery not being backward compatible. We are starting to use it…
Josh Mein
  • 28,107
  • 15
  • 76
  • 87
32
votes
3 answers

How to know in which file that defined a js global var in chrome console?

How to find out which file and line a variable was defined in using google chrome console? For example, the variable Native (from MooTools) has been defined in global scope. I want to know in which file that defined this variable using google chrome…
lovespring
  • 19,051
  • 42
  • 103
  • 153
30
votes
5 answers

Change the options array of a select list

Is there a way to change the options array of an html select list using javascript or mootools? I need to replace the entire options set with a new one. In my ajax response I receive an array filled in with with the new HTML options, so I try to…
cksrc
  • 2,062
  • 3
  • 24
  • 39
30
votes
4 answers

Javascript detect scrollbar in textarea

I was wondering if anybody knows how I would go about detecting when the scrollbar appears inside a textarea. I am currently using mootools for my JavaScript and I am having issues getting it to detect a scrollbar.
Jamie
  • 1,005
  • 5
  • 16
  • 25
1
2 3
99 100