mootools

Why do I need to do $(document.body) to extend document.body with Mootools Element methods?

大兔子大兔子 提交于 2019-12-12 12:27:11
问题 So after attempting to get my app working on the latest IE, it turns out IE doesn't like the following code: document.body.getElement('.className'); Firefox and Chrome responded okay, but document.body on IE had none of the Mootools Element methods. After looking at the documentation, some of the examples wrapped document.body in $() to expose it to the Mootools methods. Just wanted to know the reason why it works fine in FireFox/Chrome, but not automatically in IE? 回答1: This is because of

How do you grab an element from a remote page using MooTools and Request.HTML?

喜你入骨 提交于 2019-12-12 09:13:47
问题 I'm using MooTools ( part of the project ) to load a page using Request.HTML which works fine except that I don't want the whole page, just one fragment which has an id. This is the code in question var req = new Request.HTML({ onSuccess: function( res ) { // according to the docs // res should be the node list of the remote response // I want to grab #myFragment var f = res.getElementById('myFragment'); // res.getElementById is not a function var f = $(res).getElementById('myFragment'); // $

callback method in iframe to return a value to opener

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 09:11:24
问题 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? 回答1: I don't know much about SqueezeBox but I have done some work with iframe communication. Unless your iFrame and opener are in the same domain, you cannot call from one to the other. What I have done to work around this is write to the hash of the URL. The opener can then read this value and

How does jsfiddle mark up code? Is there a library for this?

两盒软妹~` 提交于 2019-12-12 08:56:25
问题 If you've ever used www.jsfiddle.net, you might notice that it marks up code with proper colorings, and various other helpers like translating tabs to four spaces or shift-tab. With Firebug I see that it's doing this with an iFrame. Is there an open source library to do this? I want to let people write Python on a web page, but make it pretty like jsfiddle. 回答1: Check out CodeMirror. 回答2: Look here (SyntaxHighlighter) Here you can find a simple tutorial. 来源: https://stackoverflow.com

mootools variable scope

强颜欢笑 提交于 2019-12-12 06:16:34
问题 how to access outer function's argument 'parent' ??? please see comments in code !! last edit : This question is misleading, my problem is caused by wrong input argument renderData : function(parent, children){ children.each(function(e, index){ var li = new Element('li'); var hasChildren = false; if(e.children && e.children.length >0){ var img = new Element('img'); img.src = 'a1.png'; img.inject(li); hasChildren = true; } if(e.icon){ var img = new Element('img'); img.src = e.icon; img.inject

dropdown hide behind mootools silder

帅比萌擦擦* 提交于 2019-12-12 05:31:31
问题 I have a custom dropdown box in mootools slider as per below image. This slider contains three div, that auto rotate in vertically one by one. Slider’s and custom dropdown’s javascript and css described below. My problem is that, when I put dropdown into slider div that hide behind slider div as per below image. According requirement, I can’t changed dropdown position and not increase slider height, then how to display dropdown list items on top off slider. Any suggestion will be appreciated.

Mootools: How to Disallow `mouseenter` and `mouseleave` event when checkbox checked?

安稳与你 提交于 2019-12-12 04:35:33
问题 Mootools: How to disallow mouseenter and mouseleave event when checkbox checked ? window.addEvent('domready',function() { var z = 2; var e = document.id('draggable'); var drag = new Drag.Move(e, { grid: false, preventDefault: true, onStart: function() { e.setStyle('z-index',z++); } }); //e.store('Drag', drag); var w = e.getStyle('width'); var h = e.getStyle('height'); e.set("morph", {duration:700,delay:400}).addEvents({ mouseenter: function(){ this.store("timer", (function() { this.morph({

SlimPicker doesn't work with jQuery plugin

為{幸葍}努か 提交于 2019-12-12 04:07:00
问题 I want jQuery and slimpicker work together, what should I do?: Sample from http://jsfiddle.net <html> <head> <link rel="stylesheet" href="http://www.styledisplay.com/scripts/slimpicker/pagestyle.css" media="screen, projection" /> <link rel="stylesheet" href="http://www.styledisplay.com/scripts/slimpicker/slimpicker.css" media="screen, projection" /> <script src="http://www.styledisplay.com/scripts/slimpicker/mootools-1.2.4-core-yc.js"></script> <script src="http://www.styledisplay.com/scripts

Problem with access to control properties in Multibox

霸气de小男生 提交于 2019-12-12 02:56:12
问题 I used multibox-component to create lightbox-similar div. But I faced problem. I placed textbox with id ‘tbx_position’ in that div. I entered some symbols in textbox and then tried to read value via javascript-function (it had to alert document.getElementById(‘tbx_position’).value). Every time that value was empty. There is example of it. Furthermore, if I place in the div asp:Button, server OnClick-eventhandler doesn’t catch fire. Is any idea, what’s reason? Thanks. 回答1: Try adding the <form

How to debug what appears to be a jQuery/MooTools conflict?

感情迁移 提交于 2019-12-12 02:39:10
问题 I am attempting to implement a jQuery plugin called Textify which I purchased on CodeCanyon. Textify requires jQuery, and I am implementing this plugin in a Joomla 2.5 environment using the Vertex framework from Shape5. After integrating the plugin into the site, I am getting 5 "'undefined' is not a function" errors. The dev site is located at http://sosdivorce.ergonomiq.net As Textify is a commercial product, I don't feel comfortable posting the script online. The specific errors I am