mootools

IE8 Crash on getStyle background-position

血红的双手。 提交于 2019-12-08 13:43:14
问题 I've found a strange bug in Internet Explorer 8. Maybe someone can help me move around it. When I try to grab the background position of an element, using background-position-x all versions of Internet Explorer work as excepted except for IE8 that crashes . When I run el.getStyle('background-position') all browsers give me the correct values except from IE (6, 7 and 8) that return undefined . I therefore use el.getStyle('background-position-x') for all IE versions. IE8, however, crashes on

YouTube API Browser-Based Upload with Ajax for Progress Bar

微笑、不失礼 提交于 2019-12-08 06:01:44
问题 I am trying to use the YouTube API to perform a browser-based upload, but also use Ajax for the purpose of showing a progress bar. I started off here: https://developers.google.com/youtube/2.0/developers_guide_protocol_browser_based_uploading It works 100% if I just use the basic HTML form post. <form id="frmYouTube" enctype="multipart/form-data" method="post" action="https://uploads.gdata.youtube.com/action/FormDataUpload/YOUTUBE_URL_HERE?nexturl=https%3a%2f%2fdomain%2fpageafter

How to set the value of a text input with MooTools

∥☆過路亽.° 提交于 2019-12-08 04:17:57
问题 I have just begun playing with MooTools, and I don't understand why the following happens: var input = new Element('input'); input.set('type','text'); input.set('value','this is the value'); console.log(input); results in: <input type=​"text">​ , so setting the value hasn't worked. But if I do this: var input = new Element('input'); input.set('type','text'); input.set('someValue','this is the value'); console.log(input); I get the expected result of <input type=​"text" somevalue=​"this is the

Does Internet Explorer support arguments.callee.name?

别来无恙 提交于 2019-12-08 03:06:07
问题 I know I can get the name of the current running function by using arguments.callee.caller.name But this does not work in Internet Explorer (any version). What's the correct cross-browser syntax? Does a workaround exist? 回答1: Apart from the fact that arguments.callee is effectively being phased out and is completely absent in ECMAScript 5 strict mode, the main issue is that Function objects in IE do not have the name property. It is implemented in some browsers, notably Firefox and recent

How to change CSS styling depends on the browser

假装没事ソ 提交于 2019-12-07 23:58:20
问题 I know there's a browser detection in mootools. Therefore, I want to know how to change the CSS styling depends on browser? -v- 回答1: if ( Browser.chrome ) { document.id('foo').addClass('bar'); } For more see Mootools documentation for Browser 回答2: Perhaps the following CSS Hacks will serve: http://www.cssblog.es/hacks-css-mediante-selectores/ Regards! 回答3: for a personal reminder, I posted this small example on jsfiddle : http://www.jsfiddle.net/ghazal/XUXAP/ Maybe it'll help you Cheers. 回答4:

Javascript scrollbar class and mousewheel speed in different browsers

久未见 提交于 2019-12-07 15:15:47
问题 I'm getting many reports that the mousewheel behaves differently in different browsers when using this scrollbar class. In some browsers (like Firefox) it's extremely slow while in others (mostly newer versions of Safari on Snow Leopard) it's perfect. Any ideas what's going on here and how to fix it? I'm using the Mootools library. One line to pay attention to here is the wheel: (Browser.firefox) ? 20 : 1 line. This is where you set the speed or steps for the mousewheel. Here it is set up in

How to get the name of a Mootools class from within

混江龙づ霸主 提交于 2019-12-07 05:52:18
问题 I'd like to get at the variable name of class. var Poop = new Class({ getClassName: function() { return arguments.callee._owner.name; } }); var a = new Poop(); a.getClassName(); //want 'Poop' I'm making that will be implemented into other classes, and I'd like to build a SQL query that uses the class name (pluralized) for the table. I've tried various combinations of the above example to try to get the name, and can't figure it out (if it's even possible considering MooTools class system).

howto create the iPhone Contacts header scroll Effect for html?

我的梦境 提交于 2019-12-07 03:54:25
问题 I've setup a basic jsFiddle to give more of an idea of what I'd like to happen. http://jsfiddle.net/nicekiwi/p7NaQ/2/ Hopefully if you think of the contact page on the iOS for the iPhone in terms of what section of the alphabet of contacts you're looking at and how it changes as you scroll the page you'll get the idea, if not read on. Basicly, I have sections of content within a single column vertical scrolling page. When the top of the first header (title 1 in the jsFiddle) get to the top of

Change event on <select>

荒凉一梦 提交于 2019-12-06 19:18:39
问题 With Mootools, if I attach a change event listener on a <select> how do I access the option that was selected. I would like the actual element and not just the value. $('select').addEvent('change',function(event) { //?? }); 回答1: Either of these will work: find by :selected pseudo selector in descendants this.getElement(':selected'); get first selected value this.getSelected()[0]; pure javascript, use the selectedIndex property this.options[this.selectedIndex]; 回答2: Just access the

How to changing my background-image css property using Mootools?

夙愿已清 提交于 2019-12-06 13:26:46
I am newbie。 How to changing my background-image css property using Mootools? Example, on page load: <div id="yourElement"></div> <script type="text/javascript"> window.addEvent('domready', function() { $('yourElement').setStyle('background-image', 'url(path/to/your/image)'); }); </script> The MooTools docs for Element.Style should be able to answer this one for you. window.addEvents({ // fire when the DOM is loaded domready: function(){ // path to the image var pathToBackgroundImage = '/path/to/the/image.jpg'; // set the background-image $(document.body).setStyle('background-image','url(' +