mootools

Mootools when using For(…in Array) problem

不羁岁月 提交于 2019-12-01 20:00:39
This problem been there for couple years. I am writing some plugins for a Forum engine called Discuz, I use a lot of Mootools for my own projects. When I plug Mootools into this forum Engine(discuz) things went crazy... After I did some debugging last year, I found that the problem is that Mootools prototype a lot of core elements, including Array, And, on the other hand, this forum engine uses a lof of For(i in Array) Loop for 'array'. Which will certainly cause problem because for(i in [1,2,3,4,5]) console.log(i); //0,1,2,3,4 the keys in this array **WITH MOOTOOLS for(i in [1,2,3,4,5])

Can jQuery and Mootools work together?

天涯浪子 提交于 2019-12-01 17:06:31
问题 Can jQuery and Mootools work together?? If not when is that case? 回答1: There's more to it than just noConflict . jQuery is an intrusive library. It adds an internal jQuery123 (for some randomised per-instance value of 123 ) property to every element it touches (which is anything with data or event handlers, amongst other reasons). In IE, this property also gets reflected as an attribute. So if MooTools or any other library (or indeed, a plain DOM method) comes along and starts messing with

How to Horizontally scroll a webpage?

≡放荡痞女 提交于 2019-12-01 16:12:06
问题 I want to develop a webpage that moves towards the left direction whenever the user scrolls down the mousewheel. Generally all websites are vertical scrolling. But this one should scroll horizontally. Example code: <body> <div style="width:10000px; height:400px; top:0; left:0;"> //here goes the content. </div> </body> My objective is to scroll the DIV horizontally on mouse-wheel scroll, using jQuery or any other Javascript tool. 回答1: Horizontal page scrolling using Javascript 来源: https:/

Avoid Adding Event Multiple Times

狂风中的少年 提交于 2019-12-01 01:30:45
问题 I am dynamically adding events using addEvent("keydown", function() {}); to an element. My problem is that there are times when this code get's run on the same element twice or more. The behavior becomes clunky as the function registered for that event runs a couple of times. Is there a way for me to only run the code above only once on an element? Maybe check if the event has already been added before? Thanks to everyone who helps. 回答1: Either don't use a new function each time, or use a

Internet explorer says Object doesn't support this property or method

怎甘沉沦 提交于 2019-12-01 01:17:57
This line is 79: window.addEvent('domready', function(){ mySlide = new Fx.Slide('advert'); mySlide.hide(); }); It also does not like this line: this.wrapper = new Element('div', { 'styles': $extend( this.element.getStyles('margin'), {'overflow': ''} ) }) .injectAfter(this.element) .adopt(this.element); Does anyone know why this happens? Does anyone know how to fix this? I am using jQuery and Mootools.. and wanted a solution. fimbulvetr In case you are landing on this page while desperately searching for why you have this error in IE, allow me to point out another way this can happen. Hopefully

Internet explorer says Object doesn't support this property or method

醉酒当歌 提交于 2019-11-30 19:27:10
问题 This line is 79: window.addEvent('domready', function(){ mySlide = new Fx.Slide('advert'); mySlide.hide(); }); It also does not like this line: this.wrapper = new Element('div', { 'styles': $extend( this.element.getStyles('margin'), {'overflow': ''} ) }) .injectAfter(this.element) .adopt(this.element); Does anyone know why this happens? Does anyone know how to fix this? I am using jQuery and Mootools.. and wanted a solution. 回答1: In case you are landing on this page while desperately

What is jQuery (edge) in jsfiddle.net?

蹲街弑〆低调 提交于 2019-11-30 10:42:19
In jsfiddle.net if one choose framework as jQuery or Mootools they will get an option for choosing jQuery ( edge ) and Mootools( edge ). I googled it quite a bit but did not get any good answers. My questions are What are those versions? How are they useful to the fiddle creator? Kyle Rogers It is the jQuery nightly build from github... jQuery JavaScript Library v1.6.3pre Live From Git (b22c9046529852c7ce567df13397849e11e2b9cc) Here is the link: link (jsfiddle uses this) Here is the jQuery github link: github-link An edge build usually refers to some kind of "nightly" or not yet released build

Parse XML in Mootools

a 夏天 提交于 2019-11-30 10:10:38
There doesn't seem to be any useful documentation out there about parsing XML in Mootools. Either it's so stupidly easy nobody could be bothered to mention it, or it's so fiendishly difficult everybody's given up trying. Does anyone have any simple cross browser method for parsing XML with Mootools? Here's my little XML file data.xml: <?xml version="1.0"?> <suggestions> <suggestion winning="Y"> <copy><![CDATA[Draw straws to see who wins]]> </copy> <person><![CDATA[Sue]]> </person> <location><![CDATA[London]]> </location> </suggestion> <suggestion winning="N"> <copy><![CDATA[Race your friends

jQuery学习笔记180924

早过忘川 提交于 2019-11-30 08:12:29
jQuery - AJAX 简介 什么是 AJAX? AJAX = 异步 JavaScript 和 XML(Asynchronous JavaScript and XML)。 简短地说,在不重载整个网页的情况下,AJAX 通过后台加载数据,并在网页上进行显示。 在eclipse上练习跳过 jQuery - noConflict() 方法 正如您已经了解到的,jQuery 使用 $ 符号作为 jQuery 的简写。 如果其他 JavaScript 框架也使用 $ 符号作为简写怎么办? 其他一些 JavaScript 框架包括:MooTools、Backbone、Sammy、Cappuccino、Knockout、JavaScript MVC、Google Web Toolkit、Google Closure、Ember、Batman 以及 Ext JS。 其中某些框架也使用 $ 符号作为简写(就像 jQuery),如果您在用的两种不同的框架正在使用相同的简写符号,有可能导致脚本停止运行。 jQuery 的团队考虑到了这个问题,并实现了 noConflict() 方法。 来源: oschina 链接: https://my.oschina.net/u/2882061/blog/2208100

How to know in which file that defined a js global var in chrome console?

杀马特。学长 韩版系。学妹 提交于 2019-11-30 05:46:56
How to find out which file and line a variable was defined in using google chrome console? For example, the variable Native (from MooTools) has been defined in global scope. I want to know in which file that defined this variable using google chrome console. zessx Using chrome : Open the Web Inspector Show the console and check if the var you're searching for exists (ex : Native Enter ) Click on the Resources panel Enter Native= , var Native or Native = in the top right search field You've got your result ! Here, there's only one result for the Native= search. The result is automatically