Page 2 of 2

Javascript function to animate collapsible set only works on first page?

Posted: Tue Mar 11, 2014 1:32 pm
by Jesper Simonsen

No actually now the collapsibles is corrupted from the start, but where did you giet the first kode from you want me to delete:
$('#List_Customers_mobilecontainer [name="collapsibleblock"]').die().live({.........

I don't think it is from our app.


Javascript function to animate collapsible set only works on first page?

Posted: Wed Mar 12, 2014 1:41 am
by Igor

Below code from your application. This is the steps how to find it:

1 open application on .../List_Customers.html page.

2 open debug tool and search through the js by "slideDown(300);".

3 you will find two places.

One of them is:
pre
code

Code: Select all

     $('#List_Customers').bind({ 
         pageshow: function() { 
             $('#List_Customers_mobilecontainer [name="collapsibleblock"]').die().live({ 

                 expand: function() { 

                     var contentDiv = $('.ui-collapsible-content', this); 

                     contentDiv.hide(); 

                     contentDiv.slideDown(300); 

                 }, 

                 collapse: function() { 

                     var contentDiv = $('.ui-collapsible-content', this); 

                     contentDiv.slideUp(300); 

                 }, 

             }) 
         }, 
     }); 

/code
/pre
It means that you have bind this JS code to "pageshow" event on "List_Customers" page.

Please delete this code and try suggested solution from upper reply. If it will not help please attach screenshot with errors.


Javascript function to animate collapsible set only works on first page?

Posted: Wed Mar 12, 2014 5:36 pm
by Jesper Simonsen

I have ben experimenting so tis code is properly from the published HTML app on appery.io domain.


Javascript function to animate collapsible set only works on first page?

Posted: Wed Mar 12, 2014 6:23 pm
by Jesper Simonsen

I have now done what you asked me to and you can see the result here: http://screencast.com/t/KdqO5bIQPXGR


Javascript function to animate collapsible set only works on first page?

Posted: Wed Mar 12, 2014 10:21 pm
by Illya Stepanov

Hi Jesper,

Ok. You have added requested code.

But this one:
pre
$('#List_Customers').bind({
pageshow: function() {
$('#List_Customers_mobilecontainer [name="collapsibleblock"]').die().live({

Code: Select all

                 expand: function() { 

                     var contentDiv = $('.ui-collapsible-content', this); 

                     contentDiv.hide(); 

                     contentDiv.slideDown(300); 

                 }, 

                 collapse: function() { 

                     var contentDiv = $('.ui-collapsible-content', this); 

                     contentDiv.slideUp(300); 

                 }, 

             }) 
         }, 
     }); 

/pre
Is still on your "List_Customers.html" page.

You have to delete this code.

Please share your app with us.


Javascript function to animate collapsible set only works on first page?

Posted: Wed Mar 12, 2014 11:56 pm
by Jesper Simonsen

I have now deleted the code on pageshow, but the result is still the same ad showed in the video:http://screencast.com/t/KdqO5bIQPXGR


Javascript function to animate collapsible set only works on first page?

Posted: Thu Mar 13, 2014 12:42 am
by Illya Stepanov

You have js file: CollapsibleAnimate.js

This file in you video has code:
pre
$(document).on({

Code: Select all

         expand: function() { 

             var contentDiv = $('.ui-collapsible-content', this); 

             contentDiv.hide(); 

             contentDiv.slideDown(300); 

         }, 

         collapse: function() { 

             var contentDiv = $('.ui-collapsible-content', this); 

             contentDiv.slideUp(300); 

         }, 

     }); 

/pre
But currently you have commented this section of code with //

Please uncomment this code by removing // and it should work.


Javascript function to animate collapsible set only works on first page?

Posted: Thu Mar 13, 2014 12:31 pm
by Jesper Simonsen

No this code was not commented when the video was taken, but to work with the app I had to disable this script. I Think we should close this thread since it is not bringing me closer to a solution.


Javascript function to animate collapsible set only works on first page?

Posted: Thu Mar 13, 2014 2:36 pm
by Maryna Brodina

Hello!

1) This code works for us pre$(document).on({
'expand': function(event) {
$(this).children('.ui-collapsible-content').hide().slideDown(300);
},

Code: Select all

  'collapse': function(event) {  
     $(this).children('.ui-collapsible-content').slideUp(300);  
     } 
 }, '[data-role="collapsible"]' 

);/pre
2) To completely expand collapsible items (not like on video), make collapsibleblock in builder collapsed by default.
3) In SelectMenu JS asset you have mistake. There should be prearr = [];/pre instead prearr = ();/pre


Javascript function to animate collapsible set only works on first page?

Posted: Thu Mar 13, 2014 10:51 pm
by Jesper Simonsen

Thank you very much - that solved the issue.