Search Results

Search found 223 results on 9 pages for 'mootools'.

Page 3/9 | < Previous Page | 1 2 3 4 5 6 7 8 9  | Next Page >

  • MooTools Event Delegation using HTML5 data attributes.

    - by Anurag
    Is it possible to have event delegation using the HTML5 data attributes in MooTools? The HTML structure I have is: ?<div id="parent"> <div>not selectable</div> <div data-selectable="true">selectable</div> <div>not selectable either.</div> <div data-selectable="true">also selectable</div> </div>???????????????????????????????????????????????????????????????????????? And I want to setup <div id="parent"> to listen to all clicks only on child elements that have the data-selected attribute. Please let me know if I'm doing something wrong: The events are being setup as: $("parent").addEvent("click:relay([data-selectable])", function(event, el) { alert(this.get('text')); }); but the click callback is fired on clicking all div's, not just the ones with a data-selectable attribute defined. You can see this example on http://jsfiddle.net/NUGD4/ A workaround is to adding this as a CSS class, which works with delegation but I would prefer to be able to use data-attributes as it's used throughout the application.

    Read the article

  • MooTools/JavaScript variable scope

    - by 827
    I am trying to make each number displayed clickable. "1" should alert() 80, "2" should produce 60, etc. However, when the alert(adjust) is called, it only shows 0, not the correct numbers. However, if the commented out alert(adjust) is uncommented, it produces the correct number on page load, but not on clicking. I was wondering why the code inside addEvents cannot access the previously defined variable adjust. <html> <head> <script type="text/javascript" charset="utf-8" src="mootools.js"></script> <script type="text/javascript" charset="utf-8"> window.addEvent('domready', function() { var id_numbers = [1,2,3,4,5]; for(var i = 0; i<id_numbers.length; i++) { var adjust = (20 * (5 - id_numbers[i])); // alert(adjust); $('i_' + id_numbers[i]).addEvents({ 'click': function() { alert(adjust); } }); } }); </script> </head> <body> <div id="i_1">1</div> <div id="i_2">2</div> <div id="i_3">3</div> <div id="i_4">4</div> <div id="i_5">5</div> </body> </html> Thanks.

    Read the article

  • [Javascript] Linux Ajax (mootools Request.JSON) Header error

    - by VDVLeon
    Hi all, I use the following code to get some json data: var request = new Request.JSON( { 'url': sourceURI, 'onSuccess': onPageData } ); request.get(); Request.JSON is a class from Mootools (a javascript library). But on linux (ubuntu on firefox 3.5 and Chrome) the request always fails. So i tried to display the http request ajax is sending. (I used netcat to display it) The request is like this: OPTIONS /the+url HTTP/1.1 Host: example.com Connection: keep-alive User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.3 (KHTML, like Gecko) Chrome/4.0.226.0 Safari/532.3 Referer: http://example.com/ref... Access-Control-Request-Method: GET Origin: http://example.com Access-Control-Request-Headers: X-Request, X-Requested-With, Accept Accept: */* Accept-Encoding: gzip,deflate Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 The HTTP request (first line) is not how it should be: OPTIONS /the+url HTTP/1.1 It should be: GET /the+url HTTP/1.1 Does anybody know why this problem is and how to fix it?

    Read the article

  • Ajax request using mootools not working

    - by benny
    Hi everyone, I try loading content into a div with this tutorial. Unfortunately, this simply loads the HTML file as a new page. This is the javascript that should do the job window.addEvent('domready', function() {      $('runAjax').addEvent('click', function(event) {          event.stop();          var req = new Request({              method: 'get',              url: $('runAjax').get('href'),              data: { 'do' : '1' },              onRequest: function() { alert('The request has been made, please wait until it has finished.'); },   onComplete: function(response) { alert('Response received.); $('container').set('html', response); }          }).send(); $('runAjax').removeEvent('click');      }); }); this is the link that should initiate the function <a href="about.html" id="runAjax" class="panel">Profil</a> and this is the div-structure of index.html. i want the content to be loaded into the "container"-div <div id="view"> <div id="sidebar"> mib </div> <div id="container"> <div id="logo"> <!--img src="img/logo.png"--> </div> <div align="center" id="tagline"> content </div> </div> </div> I dont really care what script i use as long as its compatible with MooTools 1.2, because i need it for a sliding top panel and it would be a lot more work to change it to a jquery panel for example.

    Read the article

  • Does className exist in Mootools ?

    - by anna mae
    Hi, I want to update this very simple JS to Mootools 1.2 and it's not easy. This function : function changeclass(x){ document.getElementById("content").className = "ziclass0"; document.getElementById("content").className = "ziclass" + x; } is triggered in the DOM by : <div id="someclass"> a href="javascript: changeclass(0)">Unstyled</a a href="javascript: changeclass(1)">link one</a a href="javascript: changeclass(2)">link two</a a href="javascript: changeclass(3)">link three</a </div> to call the according CSS classes like : .ziclass1 h1{ color: rgb(142,11,0); font-family: Verdana; font-size: 2.5em; letter-spacing: 0.1em; } and changes the layout accordingly in : <div id="content" class="ziclass3"> ... </div> I know I can add an event to the triggers like : $(#someclass.each(function(element,index) { element.addEvent('click', function(){ //some code }); But, how do I get #content class classname ? Through an array ? I am a bit confused here. I'd be really grateful for any help to set me on the right track

    Read the article

  • how to create a mootools 1.1 function with array

    - by liz
    i have a series of select lists, that i am using to populate text boxes with ids. so you click a select option and another text box is filled with its id. with just one select/id pair this works fine, but i have multiples, and the only thing that changes is the id of the select and input.. in fact just the ending changes, the inputs all start with featredproductid and the select ids all start with recipesproduct and then both end with the category. i know that listing this over and over for each category is not the way to do it. i think i need to make an array of the categories var cats = ['olive oil', "grains", "pasta"] and then use a forEach function? maybe? here is the clunky code window.addEvent('domready', function() { $('recipesproductoliveoil').addEvent('change', function(e){ pidselected = this.options[this.selectedIndex].getProperty('value') ; $("featuredproductidoliveoil").setProperties({ value: pidselected}); ; }); $('recipesproductgrains').addEvent('change', function(e){ pidselected = this.options[this.selectedIndex].getProperty('value') ; $("featuredproductidgrains").setProperties({ value: pidselected}); ; }); $('recipesproductpasta').addEvent('change', function(e){ pidselected = this.options[this.selectedIndex].getProperty('value') ; $("featuredproductidpasta").setProperties({ value: pidselected}); ; }); $('recipesproductpantry').addEvent('change', function(e){ pidselected = this.options[this.selectedIndex].getProperty('value') ; $("featuredproductidpantry").setProperties({ value: pidselected}); ; }); }); keep in mind this is mootools 1.1 (no i cant update it sorry). i am sure this is kind of basic, something i seem to have wrapping my brain around. but i am quite sure doing it as above is not really good...

    Read the article

  • mootools event listener disappears after element.innerHTML is changed

    - by baiano
    I putting together a page that will display a set of stored values. I am using mootools and AJAX calls to update the values without needing to refresh the page each time the user selects a new item from the drop down menus. the HTML each line looks something like: <div class="selections"> <input class="checkbox selector" type="checkbox" CHECKED /> <span class="b_name"> <select class="b_n selector"> <!-- options --> </select> </span> <span class="b_level"> <select class="b_l selector"> <!-- options --> </select> </span> <span class="values"> <!-- the values --> </span> In the head I have set up an event listener like: $$('.selector').addEvent('change', function(event){changeValues(this);}); My problem is that when the "b_name" select changes I have to update the list of options in the "b_level" select. I accomplish that by getting a list of the possible options from my database through a php script on another page and replacing "b_level"'s innerHTML. Once I do that, the event listener attached to "b_l selector" no longer works. I tried to resolve this issue by explicitly attaching an event listener to "b_l selector" each time "b_name" changes like so: row.getElement('.b_l').addEvent('change', function(event){changeValues(row.getElement('.b_l'));}); where 'row' is the html element 'div.selections'. It still isn't working and I have no idea what's going on. Can anyone offer a suggestion as to how I can get this resolved? or perhaps a better way to do what I'm doing. Thanks

    Read the article

  • Mootools Form Post Problem, Abort increasingly+1 with each request

    - by Naresh
    Hi all, i'm using Mootools 1.2. Ihave 15 Forms with same name only change in their id's like form1, form2, form3, ... ,form15 same with their elements. i need to submit all forms by ajax. For that purpos i make a function and call them on each functions onClick event. function is function addStepConfiguration(id,mystrip,comment,error,submitid,i) { $(id).addEvent('submit', function(e) { e.stop(); $(submitid).setStyle('display','none'); loading_Img(i); this.set('send', { onComplete: function(responseText) { $('loading_img'+i).innerHTML = ''; SplittedResText = responseText.split("|"); if(SplittedResText[1]=='undefined') { $(error).innerHTML=SplittedResText[0]; } else { $(comment).innerHTML=SplittedResText[0]; $(mystrip).set('class',SplittedResText[1]); removeMsg.delay(20,'',error); removeMsg.delay(1500,'',comment); } $(submitid).setStyle('display','block'); } }); this.send(); }); } When i submit a form say first one then it submitted and give response normally, but in second time without page refresh, it abort the request one time. in third attempt it abort 2 times..then go on +1 each time. It gives no error, just abort and again request automatically. i can't understand what is the problem. please any one can help me.

    Read the article

  • Image Upload with Mootools

    - by notme
    I am creating an ajax uploader with mootools. When I remove the ajax and simply upload the form I get $_FILES with the file data present. But when I use the ajax version, the $_FILES super global is empty. Every other part of the form is present. It acts as if it does not send the image at all but only in the ajax version. Any help is appreciated. Thanks! <form id="uploadphoto_pod" action="upload.php" enctype="multipart/form-data" method="post"> <input type='file' id='uploadphoto' name='uploadphoto'/> <input type="submit" class="submit" name="add_product" value="Upload" /> </form> <div id="response"><!-- Ajax Response --></div> <script type="text/javascript"> window.addEvent('domready', function(){ $('uploadphoto').addEvent('submit', function(e) { //Prevents the default submit event from loading a new page. e.stop(); //("this" refers to the $('uploadphoto') element). this.set('send', {onComplete: function(response) { $('response').set('html', response); }}); //Send the form. this.send(); }); }); </script>

    Read the article

  • Problem with Mootools Ajax request and submitting a form

    - by Arwed
    Hello. This is my problem: I have a table with content comming from a database. Now i tryed to realize a way to (a) delete rows from the table (b) edit the content of the row "on the fly". (a) is working perfectly (b) makes my head smoking! Here is the complete Mootools Code: <script type="text/javascript"> window.addEvent('domready', function() { $('edit_hide').slide('hide'); var saf = new Request.HTML( { url: 'termin_safe.php', encoding: 'utf-8', onComplete: function(response) { document.location.href=''; } }); var req = new Request.HTML( { url: 'fuss_response.php', encoding: 'utf-8', onComplete: function(response) { document.location.href=''; } }); var eDit = $('edit_hide'); var eD = new Request.HTML( { url: 'fuss_response_edit.php', update: eDit, encoding: 'utf-8', onComplete: function(response) { $('sst').addEvent( 'click', function(e){ e.stop(); saf.send(); }); } }); $$('input.edit').addEvent( 'click', function(e){ e.stop(); var aID = 'edit_', bID = '', cID = 'ed_'; var deleteID = this.getProperty('id').replace(aID,bID); var editID = $(this.getProperty('id').replace(aID,cID)); eD.send({data : "id=" + deleteID}); $('edit_hide').slide('toggle'); }); $$('input.delete').addEvent( 'click', function(e){ e.stop(); var aID = 'delete_', bID = ''; var deleteID = this.getProperty('id').replace(aID,bID); new MooDialog.Confirm('Soll der Termin gelöscht werden?', function(){ req.send({data : "id=" + deleteID}); }, function(){ new MooDialog.Alert('Schon Konfuzius hat gesagt: Erst denken dann handeln!'); }); }); }); </script> Here the PHP Part that makes the Edit Form: <?php $cKey = mysql_real_escape_string($_POST['id']); $request = mysql_query("SELECT * FROM fusspflege WHERE ID = '".$cKey."'"); while ($row = mysql_fetch_object($request)) { $id = $row->ID; $name = $row->name; $vor = $row->vorname; $ort = $row->ort; $tel = $row->telefon; $mail = $row->email; } echo '<form id="termin_edit" method="post" action="">'; echo '<div><label>Name:</label><input type="text" id="nns" name="name" value="'.$name.'"></div>'; echo '<div><label>Vorname:</label><input type="text" id="nvs" name="vorname" value="'.$vor.'"></div>'; echo '<div><label>Ort:</label><input type="text" id="nos" name="ort" value="'.$ort.'"></div>'; echo '<div><label>Telefon:</label><input type="text" id="nts" name="telefon" value="'.$tel.'"></div>'; echo '<div><label>eMail:</label><input type="text" id="nms" name="email" value="'.$mail.'"></div>'; echo '<input name="id" type="hidden" id="ids" value="'.$id.'"/>'; echo '<input type="button" id="sst" value="Speichern">'; echo '</form>'; ?> And last the Code of the termin_safe.php $id = mysql_real_escape_string($_POST['id']); $na = mysql_real_escape_string($_POST['name']); $vn = mysql_real_escape_string($_POST['vorname']); $ort = mysql_real_escape_string($_POST['ort']); $tel = mysql_real_escape_string($_POST['telefon']); $em = mysql_real_escape_string($_POST['email']); $score = mysql_query("UPDATE fuspflege SET name = '".$na."', vorname = '".$vn."', ort = '".$ort."', telefon = '".$tel."', email = '".$em."' WHERE ID = '".$id."'"); As far as i can see the request does work but the data is not updated! i guess somethings wrong with the things posted For any suggestions i will be gladly happy!

    Read the article

  • Mootools set radio button checked

    - by Gobi
    Hi i have 2 radio buttons and i used mootool while loading as window.addEvent('domready', function() { var chk="1"; if(chk==1){ $('edit-gender-0').set('checked',true); } else if(chk==2){ $('edit-gender-1').set('checked',true); } but its not working at all. any one help me will be more appreciated... and anyother short way without if condition

    Read the article

  • Mootools - how to destroy a class instance

    - by Rob
    What I'm trying to do is create a class that I can quickly attach to links, that will fetch and display a thumbnail preview of the document being linked to. Now, I am focusing on ease of use and portability here, I want to simply add a mouseover event to links like this: <a href="some-document.pdf" onmouseover="new TestClass(this)">Testing</a> I realize there are other ways I can go about this that would solve my issue here, and I may end up having to do that, but right now my goal is to implement this as above. I don't want to manually add a mouseout event to each link, and I don't want code anywhere other than within the class (and the mouseover event creating the class instance). The code: TestClass = new Class({ initialize: function(anchor) { this.anchor = $(anchor); if(!this.anchor) return; if(!window.zzz) window.zzz = 0; this.id = ++window.zzz; this.anchor.addEvent('mouseout', function() { // i need to get a reference to this function this.hide(); }.bind(this)); this.show(); }, show: function() { // TODO: cool web 2.0 stuff here! }, hide: function() { alert(this.id); //this.removeEvent('mouseout', ?); // need reference to the function to remove /*** this works, but what if there are unrelated mouseout events? and the class instance still exists! ***/ //this.anchor.removeEvents('mouseout'); //delete(this); // does not work ! //this = null; // invalid assignment! //this = undefined; // invalid assignment! } }); What currently happens with the above code: 1st time out: alerts 1 2nd time out: alerts 1, 2 3rd time out: alerts 1, 2, 3 etc Desired behavior: 1st time out: alerts 1 2nd time out: alerts 2 3rd time out: alerts 3 etc The problem is, each time I mouse over the link, I'm creating a new class instance and appending a new mouseout event for that instance. The class instance also remains in memory indefinitely. On mouseout I need to remove the mouseout event and destroy the class instance, so on subsequent mouseovers we are starting fresh.

    Read the article

  • mootools slideshow2

    - by ioannis
    hello everyone. i am using slideshow2 by Aeron Glemann in a website.Does in generate the thumbnails or do i have to provide them?the images iam showing are coming from a cloud, and are passed to the slideshow in an array.the thumbs exist in the cloud. how can i pass them in the array if the show cannot create them? i have used the replace parameter with regex but it shows as thumbnails the full image and nothing happens when i alter the css properties for the thumbnails. the images are displayed. here is the line for the show creation: var myShow = new Slideshow('show', eval(res.value), { controller: true, height: 350,overlap: false, resize: false, hu: '',replace:[/^\S+.(gif|jpg|jpeg|png)$/,'t$1'],thumbnails: true, width: 600}); the value object contains the images from the cloud in format shown below: ['xx.jpg','yy.png',....] thank you very much for your time.

    Read the article

  • MooTools Fx.Slide throwing this.element is null

    - by Brant
    The following code is throwing the error "this.element is null". However, the wid_cont is definitely grabbing an element. window.addEvent('domready',function(){ var min = $(document.body).getElements('a.widget_minimize'); min.addEvent('click', function(event){ event.stop(); //var box = ; var wid_cont = ($(this).getParents('.widget_box').getElement('.widget_box_content_cont')); var myVerticalSlide = new Fx.Slide(wid_cont); myVerticalSlide.slideOut(); } ); }); It's moo tools 1.2.4 and has the fx.slide included....

    Read the article

  • Emulate domready event with a custom event (mootools)

    - by Rob
    I need to fire a one time only custom event that functions like the domready event, in that if new events are added after the event has occurred they are fired immediately. This is for some code that cannot execute until certain data and resources are initialized, so I want to do something like this: // I am including a script (loadResources.js) to load data and other resources, // when loadResources.js is done doing it's thing it will fire resourcesAreLoaded with: window.fireEvent('resourcesAreLoaded'); window.addEvent('resourcesAreLoaded', function() { // this is fine }); $('mybutton').addEvent('click', function() { window.addEvent('resourcesAreLoaded', function() { // this is not fine, because resourcesAreLoaded has already fired // by the time the button is clicked }); }); If possible I would like resourcesAreLoaded to function like domready, and execute the code immediately if the event has already fired: window.addEvent('testIsReady', function() { alert('firing test'); }); window.fireEvent('testIsReady'); window.addEvent('test', function() { // this will never execute unless I call fireEvent('testIsReady') again alert('test 2'); }); window.addEvent('domready', function() { alert('domready is firing'); }); window.addEvent('domready', function() { setTimeout(function() { alert('domready has already fired, so this is executed immediately'); }, 500); });

    Read the article

  • MooTools Sortables with horizontal list having problems

    - by Anurag
    I am having problems sorting list items using the Sortables class when the list items are displayed horizontally. Removing this style fixed everything: display: inline Created an example on jsfiddle. This works. Check the stylesheet for .countries li - it does not display the list inline - http://jsfiddle.net/Wgpqw/ This does not work properly. I can drag the list items around the list, but the sort randomly happens when moving around - http://jsfiddle.net/Wgpqw/1/ I suspect it has something to do with the list element positioning in inline mode. Any help is greatly appreciated.

    Read the article

  • How to exit mootools each()

    - by Billy
    How can I exit the each function when the conditions was true once? This does not work: $$('.box div').each(function(e) { if(e.get('html') == '') { e.set('html', 'test'); exit; } });

    Read the article

  • MooTools Classes and JsDoc

    - by Joel Alejandro
    I have the following Moo class: Nem.Ui.Window = new Class({ Implements: [Options, Events], options: { caption: "Ventana", icon: $empty, centered: true, id: $empty, width: $empty, height: $empty, modal: false, desktop: $empty, x: $empty, y: $empty, layout: $empty }, initialize: function(options) { this.setOptions(options); /* ... */ }, setHtmlContents: function(content) { /* ... */ }, setText: function(text) { /* ... */ }, close: function(win) { /* ... */ }, /* ... */ }); I want to document it with JsDoc. I read you can use @lends [class].prototype inside new Class and mark initialize with the @constructs tag. How can I mark methods and events such? I.E.: setHtmlContents should be a method, close should be an event. Also, can the elements under options be documented, somehow?

    Read the article

  • fetch HTML Element object using javascript, mootools

    - by Avinash
    Hi, Please check my HTML below: <table cellpadding="0" cellpadding="0" border="0"> <tr> <td> <div class="toogler">Demo1</div> </td> </tr> <tr> <td> <div class="element">Demo1 Content</div> </td> </tr> <tr> <td> <div class="toogler">Demo1</div> </td> </tr> <tr> <td> <div class="element">Demo1 Content</div> </td> </tr> <tr> <td> <div class="toogler">Demo2</div> </td> </tr> <tr> <td> <div class="element">Demo2 Content</div> </td> </tr> <tr> <td> <div class="toogler">Demo3</div> </td> </tr> <tr> <td> <div class="element">Demo3 Content</div> </td> </tr> <tr> <td> <div class="toogler">Demo4</div> </td> </tr> <tr> <td> <div class="element">Demo4 Content</div> </td> </tr> </table> Here is my JS Code: <script type="text/javascript" language="javascript"> $$('.toogler').each(function(e){ alert(e); // this will alert all the toogler div object }); </script> my problem is that how can i fetch the object of the next div with class element if i have object of the first toogler then how can i get the object of the next first div which class 'element' I don't want to give the ids to the elements

    Read the article

  • Mootools Accordion nonfunctional in Opera

    - by nona
    While working as expected in all other browsers, opera refuses to tween the height of content. oddly enough, as i sat annoyed rapidly clicking it over and over again, if it's closed, and you select some text, and keep clicking the same spot long enough, sometimes it pops open. lol. seriously. ahh, it seems to sometimes open the first time clicked after the page is loaded. wth? the javascript: window.addEvent('domready', function(){ var content_height = [];i=0; $$( '.bio_accordion' ).each(function(item){ i++; content_height.push(item.getElement('.moreInfo').offsetHeight); var thisSlider = new Fx.Slide( item.getElement( '.moreInfo' ), { mode: 'horizontal' } ); thisSlider.hide(); item.getElement('.moreInfo').set('tween').tween('height', '0px'); var morph = new Fx.Morph(item.getElement( '.divToggle' )); var selected = 0; item.getElement( '.divToggle' ).addEvents({ 'mouseenter': function(){ if(!selected) this.morph('.div_highlight'); }, 'mouseleave': function(){ if(!selected) { this.morph('.divToggle'); } }, 'click': function(){ if (!selected){ if (this.getElement('.symbol').innerHTML == '+') this.getElement('.symbol').innerHTML = '-'; else this.getElement('.symbol').innerHTML = '+'; item.getElement('.moreInfo').set('tween', { duration: 1500, transition: Fx.Transitions.Bounce.easeOut }).tween('height', content_height[i]); selected = 1; thisSlider.slideIn(); } else{ if (this.getElement('.symbol').innerHTML == '+') this.getElement('.symbol').innerHTML = '-'; else this.getElement('.symbol').innerHTML = '+'; thisSlider.slideOut(); item.getElement('.moreInfo').set('tween', { duration: 1000, transition: Fx.Transitions.Bounce.easeOut }).tween('height', '0px'); selected = 0; } } }); } ); }); the html: <div class="bio_accordion"> <div class="divToggle">test<span class="symbol">-</span></div> <div class="moreInfo" style="margin-left:10px;"> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf </div> </div> the css: .bio_accordion { padding:0px; margin:0px; } .divToggle { cursor: pointer; color: #ffffff; background-color:#1089b5; padding: 8px; } .div_highlight { padding-left:30px; padding-right:30px; background-color:#096687; } .moreInfo { padding: 2px; padding-top:15px; padding-bottom:15px; overflow: hidden; } .symbol { float:right; }

    Read the article

  • MooTools - DOM Inserted Event

    - by Steve
    I would like an element to receive an event and perform some action when an element is injected into the DOM. Is there any event available to perform this? Something like the following: new Element('div', { events : { insertedIntoDom : function() { // Do something } } }) Thanks

    Read the article

  • Mootools Javascript can't push to array

    - by nona
    I have an array set with the heights of each hidden div, but when I use it, the div instantly jumps down, rather than slowly sliding as when there is a literal number. EDIT: testing seems to reveal that it's a problem with the push method, as content_height.push(item.getElement('.moreInfo').offsetHeight);alert(content_height[i]);gives undefined, but alert(item.getElement('.moreInfo').offsetHeight); gives the correct values Javascript: window.addEvent('domready', function(){ var content_height = [];i=0; $$( '.bio_accordion' ).each(function(item){ i++; content_height.push( item.getElement('.moreInfo').offsetHeight); var thisSlider = new Fx.Slide( item.getElement( '.moreInfo' ), { mode: 'horizontal' } ); thisSlider.hide(); item.getElement('.moreInfo').set('tween').tween('height', '0px'); var morph = new Fx.Morph(item.getElement( '.divToggle' )); var selected = 0; item.getElement( '.divToggle' ).addEvents({ 'mouseenter': function(){ if(!selected) this.morph('.div_highlight'); }, 'mouseleave': function(){ if(!selected) { this.morph('.divToggle'); } }, 'click': function(){ if (!selected){ if (this.getElement('.symbol').innerHTML == '+') this.getElement('.symbol').innerHTML = '-'; else this.getElement('.symbol').innerHTML = '+'; item.getElement('.moreInfo').set('tween', { duration: 1500, transition: Fx.Transitions.Bounce.easeOut }).tween('height', content_height[i]); //replacing this with '650' keeps it smooth selected = 1; thisSlider.slideIn(); } else{ if (this.getElement('.symbol').innerHTML == '+') this.getElement('.symbol').innerHTML = '-'; else this.getElement('.symbol').innerHTML = '+'; thisSlider.slideOut(); item.getElement('.moreInfo').set('tween', { duration: 1000, transition: Fx.Transitions.Bounce.easeOut }).tween('height', '0px'); selected = 0; } } }); } ); }); Why could this be? Thanks so much!

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9  | Next Page >