mootools

Modify HTML Object tag attributes with mootools in IE

Hi, I got an object tag (generated by SWFObject) which I'ld like to modify width and height properties on window resize with mootools library. With a : $('my_object').set({ 'width': new_width, 'height': new_height }); everything working fine in a firefox, chrome and others. Unfortunately, Internet explorer (7 & 8) don't see it the ...

Mootools - get form's first input, select etc item

Hi I need to get the first element from a form, could be a select, text, radio etc. I can get all the elements using the following: $('myformcontainer').getElement('form').getElements('select,input[type=text]'); And this returns all my form elements, however the problem is that the items are organised by tag type (in this example; se...

Add form element functionality to contenteditable div

Hello all, I use the MooTools Javascript library. And this library give a couple of really useful functions here: http://mootools.net/docs/more/Element/Element.Forms The problem is that this functions only work for 'form' elements like textarea, etc. Now i am making a online editor and for the editor it self i use a div element and th...

Get Child Element Value with Mootools

I'm trying to change a class by first discovering if it is the parent object to a particular image using Mootools (clients previous web developer seemed to have it in for me). I can't seem to find much good documentation on the subject. <div class="textwidget"> <img src="share.jpg"> </div> So far I've managed to locate all the divs ...

date picker in smooth box

hi all, i have used http://www.monkeyphysics.com/mootools/script/2/datepicker calendar for my smarty template site. this site is using smoothbox too. the calendar works perfect in normal pages, and also in smoothbox if ?TB_iframe=true but it not works with hidden div smooth box inlineid ...

JavaScript libraries conflicting with each other

I'm working on a modeling website for my girlfriend and she wants a large slideshow as background on the website. I used the JonDesign Gallery for that, which works nicely for this purpose and is relatively light-weight. Now, for the contact form I'd like to use something Lightbox/Slimbox style. Slimbox works with Mootools, which is als...

Adding custom code to mootools addEvent

Even though I've been using mootools for a while now, I haven't really gotten into playing with the natives yet. Currently I'm trying to extend events by adding a custom addEvent method beside the original. I did that using the following code(copied from mootools core) Native.implement([Element, Window, Document], { addMyEvent:funct...

MooTools Plugins

Hi, Im looking for some good resources for MooTools. jQuery has a nice plugins site. Does anyone know of a similar site for mootools plugins? Specifically Im looking for: Grid Component Modal Dialog Component Treeview What would you recommend? ...

Javascript framework freezes in Firefox Ubuntu 8.04, don't know what to blame

I learned web applications in the old days before there were Javascript libraries and web application frameworks. When I find time (which might not happen), I wouldn't mind updating my experience with these more modern methods. However, if I did write a web page with one of these modern packages, I wouldn't want to slam together someth...

Class Casting in MooTools?

I have a class and two other classes extending it. I essentially want to be able to make an object of the main class and then be able to convert/cast it into the appropriate subclass depending on some conditions of the object itself. Alternatively, I could replace the instance of the main class with an instance of the subclass. Are eithe...

MooTools - Re-use Request Object

I would like to re-use a Request.JSON object, but I am not sure how. I'm looking for something like the following example: // In initialize/constructor this.request = new Request.JSON( { method : 'get' }); // Elsewhere this.request.setOptions({ url : 'http://...', onSuccess : onSuccess, onFailure : onFailure })...

IE7 ul display:none/block problem

Hi to all. I've got a strange problem with IE7. This is my html: <div class="nav square"> <div> <ul> <li><a href="#square" class="square_lk">[b] square</a></li> <li><a href="#history" class="history_lk">[b] history</a></li> </ul> </div> ...

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 am thinking it may be a problem with the JSON being returned. Checking in the console I s...

Browser timing out Javascript recursive function, how to solve ?

Hi, I had to develop a newsletter manager with JS + PHP + MYSQL and I would like to know a few things on browser timing out the JS functions. If I'm running a recursive function that delays a call to itself (while PHP returns a list of email), how can I be sure that the browser wont timeout this JS function ? I'm asking this, because ...

Mootools appending html after an ajax request

Hello, I have an ajax call that looks like this, $('campaignType').addEvent('change', function(){ alert($('campaignType').value); var request = new Request({ method: 'get', url: '/admin/admin_' + $('campaignType').value + '.php', onRequest:function() { alert('Request has been made, please be patient') }, on...

MOOTOOLS variable scope

I'm using mootools: I can't figure out how to use a variable when using an addEvent. I want to use a for next loop to set values in a loop: for (x=0;x<num;x++){ var onclickText = 'function (){onclick="addPageMoveEvent('+x+'"); }'; $('pageNum'+x).addEvent('click', onclickText); } > I've search forums but not found any help. Any help...

Accessing text in a field placed by JS, via PHP

In PHP, in a particular CMS I am using a custom field, which works like google suggest. As in, for each letter I type an SQL query is performed and matching records are displayed. When clicking on a record it fills the field with that record. I am fairly certain this is all done with JavaScript. I need to know how I can access the res...

Select text and then calculate its distance from top with Javascript?

Is it possible with JavaScript to find a given string of text on a webpage, and then calculate its distance (in pixels) from the top of the page? If so, an example would be appreciated. ...

MooTools Request Failing

So I have a bit of a problem. When I ask MooTools to send a request it comes back as failed every time. I can't seem to diagnose the problem either because if I try to get the returned header info the console just gives me "Refused to get unsafe header 'Status'" Message. The only thing I can think of is that the server isn't letting me a...

Refactoring method that was previously injected with implement

Greetings, I'm trying to override or extend the Element.show() and .hide() methods in mootools in order to add some WAI-Aria toggling. I was trying to use the Class.Refactor() method like this: Element = Class.refactor(Element, { show: function(displayString) { result = this.previous(displayString); // Do my thing return...