mootools

Javascript Variable not available in external file

Is this something with javascript; or is it something else I'm doing wrong. file1.js var collection = new Object(); collection.foo = new Array(1, 2, 3); file 2.js var someClass = new Class({ bar : function() { alert(collection.foo.length); } }); index.html <script type="text/javascript" src="file1.js"></scrip...

ASP.NET MVC and Mootools

Do you know of any examples of MooTools and ASP.NET MVC? ...

Methods for troubleshooting "A script on this page is causing IE to run slowly" caused by AJAX?

I have a page in my application that refreshes some content (a list of users currently signed in) from the server every 10 seconds. This data is loaded using the Ajax class from the mootools framework, specifically with Javascript that looks like: var xmldata = (function() { new Ajax('xmldata.jsp?time='+$time(), {method: 'get', onCo...

Mootools request - cannot make the examples work

I've downloaded the examples for both the Request and Request.HTML and cannot make either work. I unzipped them to a folder and browsed to their index.html to execute them as is, but the response is always "The request failed." with no clues as to why. I've played around with them with different permutations and can get the request to c...

What is the best way to make a side-scrolling website load quickly?

Hey everyone, I'm new to stack-overflow and programming so forgive me for any awkward phrasing! I am building a side-scrolling website which is graphic-rich, and 680x9400px in size. I will be using some javascript and/or mootools to create a cool side-scrolling effect, similar to http://sursly.com. I am web optimizing all the images ...

Best way for multiple anchor links to reference a single value that can be used in JavaScript

I have any number of anchor links on a page that need to execute the same block of JavaScript code on click, and that code needs to be associated with one value. There are several of these on each page. I usually use a hidden input to store the value in a one-to-one relationship, but what is the best way to associate several links placed...

How to select even or odd elements based on class name

if you create html layout like so <ul> <li class='a'></li> <li class='b'></li> <li class='a'></li> <li class='b'></li> <li class='a'></li> <li class='b'></li> <li class='a'></li> <li class='b'></li> </ul> and try to select odd elements with 'a' class like so $$('.a:odd') you will get empty array...

ASP.NET Forms Authentication using third party javascript library

I have a website where I currently use ASP.NET's built in Authentication, profile and role management. I would like to move some functionality (including authentication) to the client side using a third party javascript library like JQuery or Mootools without the use of ScriptManager and generated proxy classes. There is very limited in...

Mootools - Targeting child elements with an .each selector

I'm trying to target a UL that's inside a LI and I'm having trouble. Here's the HTML: <ul id="main_nav"> <li class="main"><a href="#">Section 1</a> <ul id="dropdown"> <li><a href="#">Item 1</a></li> <li><a href="#">Item 2</a></li> <li><a href="#">Item 2</a></li> </ul> </li> <li class="main"><a href="#">...

Mootools and JQuery Integration

Dear all I am using the code Mootool[1.11.] and JQuery[1.2.6],Its working fine when these are separate. While i am integrating firefox throws (document).ready(){} is not a function. Is any wrong in my concept, What to do to rectify it?.Any help ...

Equivalent code in JQuery When integrating other Library

Dear all I am using Mootools 1.11 and Jquery 1.2, ajax function not work properly for following code jQuery(document).ready(function($) { confirm("Hello"); function confirm(message){ $.ajax({ url: 'ajax.php', .... }); ...

How to Control a Class Name class="fValidate['required']" in MooTools

I am using fValidator plugin for MooTools, and find necessary to control (depending on user selections) the required class it's used by the plugin. The class uses a weird formatting which have never used before and for some reason mootools can recognize it. It probably has something to do with escaping the square brackets and the singl...

open file select dialog with javascript

I have hidden input type=file field, and i want to open its select dialog with javascript. I tried to fire click event on this element, but without luck. Im using mootools. $('input_id').fireEvent('click'); This is possible at all? ...

Simply Div Opacity Fade on Focus using mootools

I've got a couple of divs in a page which hold simple HTML & images. The divs each have unique ids. I'd like it so that when the page loads the contents of the div are say, 60% but on mouseover the fade in at 100%. On mouseout they would go back to 60%. The site is built in Joomla 1.5.x so already loads the mootools 1.11 library. I was...

Change a variable to a literal at runtime?

Hello, I am a bit of a beginner with javascript and I can't think of a way around the folowing problem. I am using Mootools in this example, though this is not a Mootools question: for (var i = 0; i < 5; i++) { myElement[i].addEvent('click', function () { otherFunction(i); }); } Whenever someone clicks on myElement, otherFunction...

Mootools addEvent not defined

I'm trying to use this code to add an anchor element and set it's onclick event to some Javascript. But no event is being loaded. Looking at the DOM through Firebug tells me that Mootools is indeed added. The element has almost all of the Mootools element functions. But it lacks addEvent. var delete_ctl = new Element('a', { 'hr...

What is the jQuery equivelent of mootools Array.include() ?

I'm trying to add an element to an array only if it doesn't already exist in the array. I used to do this with the Array.include method of mootools, but now I'm using jquery. Is there a method to do this in jquery? http://mootools.net/docs/Native/Array#Array:include ...

Looking for particular alert box behavior

I'm interested in alert boxes such as, http://www.visual-blast.com/javascript/nice-alert-box-with-jquery-impromptu/ and http://woork.blogspot.com/2008/08/design-stunning-alert-box-using.html but with a different functionality, the user should be able to interact with the page even with the alert box present, so it needs to be movable...

Mootools Lightbox for a html div?

I'm wondering if anyone has ever come across a plug-in for mootools that will show a hidden div (with embedded video in it) as a light box, upon a click on a link. What I wanted is somehow like how apple trailers site show the embedded quicktime player. ...

Problems with encoding Json request

I try to manually build a Json string to send to the client. {'result':'hhh'} When I use echo json_encode(array('result'=>'hhh')); It arrives perfectly. But when I do echo "{'result':'hhh'}"; It isn't The only difference I find between the two requests is that the first one has: Content-Length: 9 header and the second o...