mootools

MooTools and jQuery conflict - despite Dollar Safe Mode

心已入冬 提交于 2019-12-11 04:12:10
问题 I'm trying to get some pre-existing MooTools code to function properly within a Drupal site. I know the MooTools code works on its own. Once I load the MooTools library in the page, jQuery stops functioning. I am including MooTools after jQuery, which (according to the MooTools developers) should prevent Moo from stealing the already defined $ from the already loaded jQuery library. I've converted all references of $ within my Moo code to document.id. When I load the page, the Moo code works

How to populate xml doc in div from another div like an iFrame using ajax?

风流意气都作罢 提交于 2019-12-11 04:03:10
问题 I have a "sidebar" div with links that I would like to link up to some xml files. (with xslt that references three other xml files) I would like the xml to be displayed in the "body" div kinda like an iframe. I cannot find a good solution for this as I am using the browser's native XSL transformation and not "wrapping" the xml up into html. I have been looking into an ajax solution but can only find ajax scripts that populate html or txt files. I have also looked at jquerys .load() solution

Suspending event listeners

▼魔方 西西 提交于 2019-12-11 03:55:14
问题 I've got a button with an onclick event listener attached (in MooTools). It works fine. However, I want to be able to make the button unavailable at a certain time, and make it available again when necessary. Simply put: I want to 'suspend' the event listener. Can this be done? The MooTools docs only go into adding, removing, cloning and propagation of events. Not 'ignoring' them for a while. I understand the solution for this can lie elsewhere: Hide the button with some css, e.g. $('button')

Jquery-Mootools conflict

▼魔方 西西 提交于 2019-12-11 02:58:12
问题 i have been trying to make 2 scripts(1 mootol and 1 jquery) work at the same page to no avail..been researching many a forums and all but i still cant make the 2 work simultaneously. this is how it looks in my header: <script type="text/javascript" src="<?php bloginfo('url'); ?>/wp-content/plugins/buddypress/bp-themes/bp-default/js/jquery-1.4.2.min.js"></script> <script type="text/javascript"> jQuery.noConflict(); $(document).ready(function () { var hide = false; $("#posts-menu, .submenu")

Mootools accordion with a Next button inside each pane

最后都变了- 提交于 2019-12-11 02:31:54
问题 I'd like to add a Next button to all (well... all except the last) panes of an accordion navigation device. As you'd expect, when you click the Next button, the current pane collapses and the next one opens. It's on a Joomla site, and so we're using MooTools. I'm having trouble getting the action of the click event to work. Any thoughts? window.addEvent('domready', function() { var accordion = new Fx.Accordion($$('#accordion h2'),$$('#accordion .content'), { onActive: function(toggler,element

mootools: $ not defined

假装没事ソ 提交于 2019-12-11 01:10:03
问题 I've strange error i don't understand. I'm just moving my code from jQuery over to Mootools because it's much cleaner than the jQuery mess. Now when i use the $$('div.canvas') in mootools i get the correct element. When i try $(document).getElement('div.canvas') it tells me that $ is not defined. How can $$ and all helper functions like $lambda etc. be defined but not $ ? Has something changed there from 1.1 to 1.2 and the docs are not updated yet? 回答1: as someone pointed out, when $ is

MooTools - How to use getSelected()

我的梦境 提交于 2019-12-10 18:21:35
问题 I'm trying to learn MooTools and am a TOTAL javascript noobie so please be gentle with me. What I'm tying to do is to change the state of a disabled input field (type is text) when a particular option is selected. The html looks a bit like tis: <select class="wide" id="selectBox" name="option> <optgroup label="Common"> <option value="one">One<option> <option value="two">Two<option> <option value="three">Three<option> </optgroup> <optgroup label="Less Common"> <option value="other">Other

Mootools and ExtJs 4.x seem to be incompatible, how to solve?

十年热恋 提交于 2019-12-10 16:42:56
问题 Mootools and ExtJs have a compatibility issue when used on the same page. Mootools throws the following error : Uncaught TypeError: Property 'id' of object #<HTMLDocument> is not a function How can we use both frameworks side by side ? Is there a workaround ? 回答1: This looks like a document.id('..') reference issue, it is defined but it's not the mootools method... Nothing will work if it's not pointed to the mootools method. I would argue that ExtJS or your app has added a property id to

How add css class with Mootools

蹲街弑〆低调 提交于 2019-12-10 16:18:11
问题 <div class="generic_layout_container layout_ride_ridespec"> </div> How to programmicaly add an extra class or one more property with existing class to above div. I would like out put as follows <div class="generic_layout_container layout_ride_ridespec example_class"> </div> Please excuse id/name solution, there is little difficulty to add an id or name for above element. Thanks 回答1: MooTools does have an addClass() method. Eg: HTML <div id="myElement" class="testClass"></div> Javascript $(

What's the downside of using too much JavaScript?

心不动则不痛 提交于 2019-12-10 13:25:29
问题 I would like to know what are some downsides using too much JavaScript code in a web page? For example, I will use a jQuery framework for my dropdown menus, tabs and accordion. And other JavaScripts for my calendar (even-though there is available calendar that uses jQuery) and other JavaScript for other stuff? What is the effect? (My opinion is conflicting of JavaScript and heavy to load) I know a lot of developers that masters more than 2 JavaScript frameworks. My question is: When