mootools

What kind of JavaScript is this?

I have an application that has this format scattered around but I dont know what kind it is. It's not jQuery, so what is it? $('some_edit').style.display = "block"; $('some_views').style.display = "none"; I get this in firebug and I know the element is present: $("some_edit").style is undefined ...

How to use AJAX Post to invoke ASP.NET MVC Controller action and return new View?

I am working a site in ASP.NET MVC where the user is presented with a calendar, and clicking on a particular calendar date invokes the following function: function selectHandler(event, data) { var myRequest = new Request.HTML({ url: '/Calendar/EventList', method: 'post', data: ...

HTML in Mootools' Element constructor?

I'm currently using the Mootools Element constructor method to dynamically add a new row into a table. function newPermission(somedata) { var newUserPerm = new Element('tr', { 'html': '<td>foo</td><td>bar</td>' }); newUserPerm.inject('permissions_table'); } However, upon checking the resulting code, the following H...

Convert five lines of Mootools to jQuery

Can someone please help me out with this? I'm using jquery-1.4.2. http://jsfiddle.net/Ymkpb/ Thank you so much! Edit - Adding the original so this is more useful later: $$('.clickables').each(function(clickable) { var list = clickable.getElements('li'); list.addEvent('click', function() { var link = this.getElement('...

Ajax response always coming up undefined

Here is my JavaScript code: $('check_username').addEvent('click', function(e) { var req = new Request({ url: 'Namecheck.php?name='+$('user_name').get('value'), method: 'post', onRequest: function() { alert('Namecheck.php?name='+$('user_name').get('value')); }, onComplete: function(response) { alert('The response is the...

CSS/Javascript (Mootools I think) Label placer

Hi there, I've been asked to place a form on our website, simple you might think, but this one has some cool little js in place to make the label for the input sit inside it, clever but for some reason not working as intended on my page. It doesn't place the label inside the Input field. It uses the JS to place the label and CSS for th...

Horizontal scroller with Mootools

I'm working on a site for myself, and I'm using a custom horizontal scroller done with Mootools that I got from another site (and got their permission to use). While I've managed to get the scroller to function the way I want to, there are two issues I'm looking to fixed and don't have the know-how myself to figure out. I've set up a si...

Mootools wildcard selector

How can I select all elements whose IDs start with "row_", for example "row_223425" and "row_at264" etc.? What I am ultimately trying to do is give a background colour to each even .productWrapper div in this structure: <div id="container"> <div id="row_2531865"> <div class="productWrapper"> Product 1 content here....

Converting from Mootools to Jquery

I have started to convert a code on my site to jquery from mootols I would like to include jQuery instead of mootools and then write some functions I'm using in mootools to jQuery so I can use the exact same code. Some of the code I'm using I already converted is for example: jQuery.fn.addEvent = jQuery.fn.bind; However I'm having...

How can I inject a string of HTML into an element?

Using Mootools, we can inject an element into another element: $('childID').inject($('parentID'), 'top'); The second parameter allows me to control the location and can either be 'top' or 'bottom' to inject it into a parent object or 'before' or 'after' to inject it as a sibling. We can also set the HTML of an element from a string: ...

How can I create a new element with html special character content in MooTools?

I'm trying to convert about 200 lines of my jQuery code into MooTools to avoid including two libraries on an existing site. I'm having a problem with just one line: new Element('span', {text: ' &raquo; '}).inject(elem); Once I inject the span, the text becomes: &amp;raquo;" How can I prevent MooTools from escaping the ampersand? He...

Onclick form submit using mootools

Hello, I am using JQuery onclick submit event like this <script type="text/javascript"> $(function(){ $('#button').click(function(){ $('#form').submit(); return false; }); }); </script> I want to do it with mootools. Thanks ...

Getting all visible elements using MooTools

Hi, I am moving from jQuery to MooTools (for the fun..) and I have this line of code : $subMenus = $headMenu.find('li ul.sub_menu:visible'); How I can write this in mootools? I know that I can use getElements but How I can check for visible ul?(I am using this(:visible) selector a lot). Edit - I implemented my own function : f...

hover over image thumb to reveal floating slideshow like on hotels.com

On hotels.com when you hover over a hotel listing's image thumbnail a small floating slideshow pops up sliding through multiple images of the hotel. Can anyone point me to a Mootools or Jquery script that does this? thanks for any ideas. ...

Slowing down a Mootools' element highlight?

So, the highlight element method is great! $('flashyflashy').highlight('#fcc'); Except it's in an out much too quickly - are there any options I can modify, similar to Tween's duration: 'long'? Thanks :) ...

Event removal in Mootools, and syntax of event addition

So I have been adding my events thusly: element.addEvent('click', function() { alert('foobar'); }); However, when attempting to remove said event, this syntactically identical code (with "add" switched to "remove") does not work. element.removeEvent('click', function() { alert('foobar'); }); I assume this is because the two...

how to determine when a request in completed in mootools?

Hi, I am new to moootools and I am creating a Template class,This is my code - var Template = new Class({ Singleton : true, template : '', /* gets the component type template */ get : function(componentType){ var tplUrl = Core.getUrl('backend') + 'response/' + componentType + '/get_template.php', that = this, ...

Is there a version of a Mootools Auto-collapsing breadcrumb like the jBreadCrumb plugin for jQuery?

Is there a version of a Mootools Auto-collapsing breadcrumb like the jBreadCrumb plugin for jQuery? http://www.comparenetworks.com/developers/jqueryplugins/jbreadcrumb.html ...

Scope of THIS keyword in Function?

Should 'this' in the following code not still refer to the DOM object selected by the MooTools selector? $$('div').addEvent('click', function() { var click1 = function(){$(this).setStyle('background', 'red');} click1(); }); ...

Mootools return to top of containing div?

I use a mootools-based pagination which works fine. However, I would like after a user clicks to a new page (from the bottom where the pagination links are clicked) to return the new set of comments and scroll back up to the top of the container div. Is there a function to do something like that with mootools? Here is the code that ne...