Collapsible don't expand
See original GitHub issueHi everyone! I’m doing my first steps with Materialize. I want to generate a dynamic list from an XML file. The problem I have is that the results are not expanded. Here’s the code:
$(document).ready( function() {
$('#term').keyup( function() {
$.get('search_xml.php?q='+escape($('#term').val()), function(data) {
html = '<div id="results"><ul class="collapsible" data-collapsible="accordion">';
$(data).find('tarifa').each( function() {
var ep = $(this);
html += '<li>';
html += '<div class="collapsible-header"><i class="material-icons">place</i>'+ep.attr('localidad')+'</div>';
html += '<div class="collapsible-body"><p>Lorem ipsum dolor sit amet.</p></div>';
html += '</li>';
} );
html += '</ul></div>';
$('#results').replaceWith( html );
} );
} );
$('.collapsible').collapsible({
accordion : true
});
Can you help me? Thank you in advance. Sergio
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Collapsible not expanding - javascript - Stack Overflow
When clicking the div, I want the collapsed content to expand. ... the first time your script is fired, there is no var...
Read more >Collapse or expand parts of a document - Microsoft Support
To collapse or expand all the headings in your document, right-click the heading and click Expand/Collapse > Expand All Headings or Collapse All...
Read more >Video: Collapsible headings - Microsoft Support
You can quickly add an outline level and make part of your document collapsible by adding a heading using Word's built-in styles. Collapse...
Read more >Collapse - Bootstrap
If you've set the collapsible element to be open by default using the show class, set aria-expanded="true" on the control instead. The plugin...
Read more >Unable to use collapsible/expand markdown - support - HUGO
No html inside (I copied and pasted the example you gave), so I thought it's because of the html or the shortcode html-like...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve the same problem! I’ve solved removing:
for dynamic content you need to call
every time the content is updated.