mootools

how to reuse effect instance on jquery

On mootools I'm used to declare once and reuse often. An FX example would go like this: myEffect1 = new Fx.Slide($('myElement1')); How should I go on jQuery? Meaning, the docs make it straightfoward to use: $('myElement1').click(function(e){ this.slideToggle(); }); But if I want to call this effect somewhere else on my code wil...

Determine whether element has fixed or percentage width using JavaScript

Using Mootools Element.Dimensions I can get the computed size, in pixels, of any element. However, I can find no way of telling whether an element has been sized using pixel or percentage values (other than in the special case of its having an inline style). Is there a sensible way of doing this? The only solution I can think of (which ...

how to prevent conflicts between mooTools and Prototype

Hi All, I know that jQuery.noConflict() is used to avoid conflict between $ of any other library and jQuery.(i.e. Prototype) But lets say, by any chance I am using Prototype, MooTools and jQuery.In that case jQuery.noConflict() will work fine for jQuery and any other library combination, but then what with Prototype and MooTools, if the...

Dynamic JavaScript loading with compression

Hi, Although I am using the Zend framework, MooTools JS library and my questions revolves around them, this is a more generic question. I am working on a web app, in which I am using many elements which are sometimes useful on other pages (for example OpenLayers related MooTools classes). Mootools already allows this "segmentation" by...

is there a viable way to feature detect support for image:data base64

using something along the lines of: background:url(data:image/gif;base64,R0lGODlhIwAhALMAAAAAADQ0NENDQ25ubouLi6ioqLa2ttPT0/Dw8P///wAAAAAAAAAAAAAAAAAAAAAAACwAAAAAIwAhAAAIpQABCBxIsCCAAAYTKlw4cECCAQwjMnSY4KHEiwQpVrSIUaLGjRw7Kvy4EYEAkSNBljyJ0iDJiiZbulQJk6XMhjQTxLyJk+ZOngBe6rTJU+jPojmTKqXZc6nTpAKFPp0qsMDUqyoHWsWKleBWrk8LfgV5AKjYnGXNakWrdi3Nt...

MooTools: Set focus on click

I've got an ASP.NET control that contains a checkbox. I want the focus to remain on this checkbox when it's clicked. Here's what I'm using: <script type="text/javascript"> window.addEvent("domready", function() { var acceptCheckId = $("<%= this.accept.ClientID %>").getElement("input"); acceptCheckId.addEvent("click...

How to check if mootools.js is actually being used within a web site?

I inherited a web site project that includes mootools.js (about 40k) in most of the scripts. However, I have not seen, intuitively, where it is being used and given the nature of this porject, ahem, I'm thinking it might not be being used at all! I'm "under the gun" to ship this tonight (yup, it's a pre-Thanksgiving release). I have not...

What is the (function($)) for in MooTools Javascript

I was reading a post by David Walsh on creating a sprite menu with MooTools. I am fairly new to MooTools, and I did not understand the way he opened his script. In particular, what is (function($){ .. })(document.id) Is it a type of JS closure? Here is the full script if you don't want to follow the link: (function($) { window.a...

Mootools script not working in Camino/Firefox

Hi there. I currently have script that slides down a once the page has loaded. So far, it works in Safari, Opera and IE8, however it doesn't work in Camino nor Firefox, so I am guessing it's a Mozilla based problem with my code? Here is my full file: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtm...

IE8 Crash on getStyle background-position

I've found a strange bug in Internet Explorer 8. Maybe someone can help me move around it. When I try to grab the background position of an element, using background-position-x all versions of Internet Explorer work as excepted except for IE8 that crashes. When I run el.getStyle('background-position') all browsers give me the correct v...

String Dot String (Mail without Domain) RegEx

Hi mates, Really got stuck on this simple regex. Need it to validate a string, that will be a mail without the "@domain.xxx". It must accomplish the following rules: there must be a string (only letters) starting. there must be a string (only letters) ending. this two strings must be separated by a dot. the complete string mustn't co...

MooTools: Parsing Ajax responseTree

I have an Ajax request to an XML document. The XML document is an RSS feed. Here's my onSuccess for the request: onSuccess: function(responseTree) { // process <item> elements } How do I enumerate <item> elements and retrieve the various child values? ...

How to move an element around DOM tree without affecting related javascript?

In this case I have a containing an iFrame that has an editor, mooEditable. I clone the element with IDs, destroy old one and insert new one where needed. Javascript component doesn't work anymore at this stage. If there is a generic way to do this, it would be terrific if you share it. TIA ...

Form post using motools ajax and form check with motools form check.

Hi, I am using motools script for client side validation of web form. here is the link for that script http://mootools.floor.ch/en/demos/formcheck/ My problem is that when only form validation is used and form is subimitting with normal method is fine but when form validation is used and form is submitting using AJAX with motools. so...

Resizing images on mouse over (Javascript/MooTools)

I've built a webpage that's supposed to increase the size of images onmouseover. I'm not replacing the images with bigger ones but rather "stretch" the existing ones because of system limitations. Here's the webpage: http://www.moviez.4pu.com/IMDBQueries.aspx You can see that the movie images get bigger when you're on them. Problem i...

"read more" link in mootools

Hi! I need a plugin for mootools like this. It's just a simple button which, when clicked, opens up a hidden portion of a div with an animation. When the page is loaded it closes to a point (truncating to some x characters) in the same div. If you take a look at the link, you'll understand... But I need it for mootools, not jQuery. :(...

ajaxify multipart encoded form (upload forms)

is there a way to do this? I'm not looking for an alternative plugin (like FancyUpload or Uploadify), I just want to know how I can ajaxify the submission of an upload form. ...

hiding a span in mootools

hi geeks!!! i'va simple code in mootools which shows hides a span tag..but by default, it sows the text which i want to be shown only upon clicking a show button.. can anyone tell me how to hide a span tag in mootools? Element.implement({ fancyShow: function(){this.fade('in');},fancyHide: function() {this.fade('out');}}); ...

optionals skipping of fx in mootools

Hello Is there a simple way to skip all the fx, while still setting the values and calling the events. I figured out to set the fx duration options globally to 0 by doing Fx.prototype.options.duration = 0 but this still doesn't solve my problem because it sill takes some minimal time which ends up in a lot of displaying errors. wha...

(Override || Extend) Javascript Method

Hi, I want to change the method DomElement.appendChild() to work differently when applied on an Object that I have created: // using MooTools; var domElement = new Class({...}); var MyObject = new domElement(...); $(document).appendChild(MyObject); // Error // I want to add to (extend) appendChild, to do something specific, when: al...