mootools

MooTools: Remove CSS class from element

How do I remove a class from an element? I see in the documentation there's an $().swapClass(), but I don't see a $().removeClass(). ...

MooTools: How to get innerHTML of element?

I've created an element as shown: var imageElement = new Element('img', { 'src': item.Url, 'alt': item.Id, 'height': height + 'px', 'width': width + 'px', 'styles': { 'padding-left': paddingLeft + 'px', ...

How to chain an array in mootools?

Say you have an array in mootools: // get the elements and set them as slide var slideElements = $$('.mySlideElements'); slideElements.set('slide'); // and fire the event -> would slide all elements out at the same time slideElements.slide('out'); How could I put this into a chain to slide them one at a time? So far I've only succee...

load articles ajaxly in joomla

Hi there, Is there anyway to load content body by click on its title ajaxly in the same page? should I make changes in template or use an extra extension? also just can use javascript plugins and not changing them unless they have a specific manual for the certain plugin. Regards... ...

How to get a Mootools event on an element passed to mako by cherrypy to work?

So I have in index.py: class Test: @cherrypy.expose def index(self): return mylookup.get_template('test.html').render(item="<div id='blah'>test</div>") And in test.html: <script> window.addEvent('domready', function() { $('blah').addEvent('click', function() { alert('success'); }); }); </script> When click...

JavaScript, MooTools and variable/object scope

I might be using the wrong patterns here, but if I am, I hope someone can correct me! I have an object which represents a user's workspace and, in response to a server action, it clones a div, changes some of its properties, positions it on the workspace, makes it draggable and adds an onComplete action. This action is intended to call ...

Flash with Div or HTML overlay and mootools Fx.Slide

I've tried a bunch of different variations of CSS to try and overlay HTML over SWF objects but I've had a couple of hitches. Safari 4.0.3 PC: SWF Object always render above HTML. Firefox 3.5.6 PC: Rendering apprears fine but when animating HTML over SWF'S the divs slightly flicker. I'm using the Fx.Slide class from mootools-more-1....

a simple question on jquery closure

what does this mean? (function($){ })(jQuery); to make the question clearer, what does wrapping a function in parenthesis mean in JS (sorry, I'm a bit confused on the concept of closures). What about the $ parameter? and the "jQuery" in the end parenthesis? Can I do the same with mootools and combine them in 1 JS file? (function($){...

Mootools Tween Question

Never worked with mootools and have this code. Instead on just injecting the content without effect, I'd like it to fade in but can't figure out how to add the fade('in') and make it work. onSuccess: function(text, xml) { new Element('div', { 'html': text }).inject($(object), 'after'); ...

MooTools JSONP request not works with invalid password

I make a JSONP request using MooTools: var username = 'hsz'; var password = 'pass'; var req = new Request.JSONP({ url: 'http://api.blip.pl/profile.json', method: 'get', headers: { 'Authorization' : 'Basic ' + Base64.encode(username + ':' + password), 'Accept' : 'application/json', 'Content-Type...

Rotating Product images so they look like there merging into a differnent view

Imagine a page with three thumbnails on of differnent product views. When you click on a view the main image div would quickly transition into the new view. Say it was a shoe i was photographing and it had a sole view, top view and side view. My question is is there any way of giving the illusion of a spin e.t.c from one view to anot...

MooTools: Fade out element?

I have an Element object that I'm currently calling .hide() on. Instead, I'd like to fade out the opacity of the entire Element (and its children) to 100% (hidden) as a transition effect over maybe 500 ms or 1000 ms. Can Fx.Tween be used for this? Is this possible--does the MooTools framework have an effect like this in its UI library? ...

Using .bind (mootools) with onClick event

I have the code (inside one object) onclick: this._addX.bind(this) and then inside another object onclick: this._addY.bind(this) Now, _addX() and _addY are nearly identical, except they both end up calling (on the click event) a function with different argument values, say _addX calls foo('x') and _addY calls foo('y'). So I tried: ...

Code Help, Mootools fading image on the gallery

Hi, I need help enhancing this Gallery (tutorialdog.com/javascript-image-gallery-using-mootools/), I've tried on my own (I'm new to js programming), But I haven't figure it out how to code it right resulting to the effect that I want. I've tried chaining the opacity but I wasn't successful. here's the code window.addEvent('domrea...

Javascript array iteration using for..in with MooTools included

I am iterating over an array in MooTools but seeing additional items when iterating through the array using the shorthand for..in loop. It works fine when I use the regular for loop. Is this a problem with MooTools polluting the global namespace or am I doing something wrong here? There is a createTabs() function that iterates over an a...

Mootools - selecting a DOM element by its classes

I use MooTools, and I need to find the element which has both classes "a" and "b" (the innermost div in my example below). The HTML structure is: <div class="a"> <div class="otherclass"> <div class="b"></div> </div> </div> In jQuery it's $("div .a .b"), as far as I know. What's the mootools syntax? I've tried $$("div ....

Adding Elements inside another DOM element in MooTools

Can I add an object of Elements inside another DOM element using grab or inject or anything else? There are two items in the object, both of type Element that are created through Javascript: var firstElem = new Element("div", {text: "something"}); // <div>something</div> var secondElem = new Element("div", {text: "else"}); // <div>...

How to find an element using CSS2 Selector in Motoools and hide it?

Hello! How can i find this span element with class="rocon.rocon-br" in #conttile2 by Mootools' Css Selector? This element is created dynamically by Javascript (rounded corner), so this is what i see in Dragonfly Dom tree for it: html > body > div#wrapper.wrapper > div#penalties.container > h2#conttitle2.rc10.rocon__8.rocon-init > span....

Mootools: Dynamically creating pagination links

I am trying to dynamically create pagination links based on the total number of results returned from a JSON query. I am using a for loop to create a new "a" tag for each page. I want to add an onclick event to each link that passes in loop index to a function that changes the page. The problem is that the index passed into the functio...

callback method in iframe to return a value to opener

I have to call a callback method in iframe to return a value to opener. I know SqueezeBox has "assign, open, close" static methods, but I do not understand how it works, can someone help me please? ...