logo
down
shadow

Load Accordian Panel on click rather than page load


Load Accordian Panel on click rather than page load

By : user2957039
Date : November 22 2020, 03:03 PM
hop of those help? I am using a Google Map and Street View javascript code within two panels using Bootstrap Accordian. The first panel contains the map and the second contains the street view. Currently both panels load their JS code on page load but the second panel is collapsed so only the Map panel is visible. , you can try something like this:
code :
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example of Twitter Bootstrap 3 Accordion</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css">
<script src="http://getbootstrap.com/dist/js/bootstrap.min.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>

<style type="text/css">
    .bs-example{
        margin: 20px;
    }
</style>
<script>
$(document).ready(function(){
$(".accordion-toggle").on('click',function(){
if($(this).attr('href') =="#collapse2"){
    alert('hi');
    initialize();
}
});
});


function initialize() {
      var fenway = new google.maps.LatLng(42.345573, -71.098326);
      var mapOptions = {
        center: fenway,
        zoom: 14
      };
      var map = new google.maps.Map(
          document.getElementById('map-canvas'), mapOptions);
      var panoramaOptions = {
        position: fenway,
        pov: {
          heading: 34,
          pitch: 10
        }
      };
      var panorama = new google.maps.StreetViewPanorama(document.getElementById('pano'), panoramaOptions);
      map.setStreetView(panorama);
    }

</script>
</head>
<body>
<div class="panel-group" id="accordion">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion"
href="#collapse1">Local Map</a></h4></div>
<div id="collapse1" class="panel-collapse collapse in">
<div class="panel-body">
**Google Map JS**
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" 
href="#collapse2">Street View</a></h4></div>
<div id="collapse2" class="panel-collapse collapse">
<div class="panel-body">
 <div id="map-canvas" style="width: 400px; height: 300px"></div>
<div id="pano" style="width: 400px; height: 300px;"></div>
</div>
</div>
</div>
</div>
</body>
</html>                                                              


Share : facebook icon twitter icon
how to click on second panel of Accordion yii widget on page load?

how to click on second panel of Accordion yii widget on page load?


By : mariem hady
Date : March 29 2020, 07:55 AM
should help you out You can pass zero-based index of opened panel via options active parameter, as it described here: http://api.jqueryui.com/accordion/#option-active. In your case the code will be:
code :
$this->widget('zii.widgets.jui.CJuiAccordion',array(
    'panels' => array(
        'panel 1' => 'content for panel 1',
        'panel 2' => 'content for panel 2',
        // panel 3 contains the content rendered by a partial view
        //'panel 3' => $this->renderPartial('_partial',null,true),
    ),
    // additional javascript options for the accordion plugin
    'options' => array(
        'animated' => 'bounceslide',
        'active' => 1,
    ),
));
Load new panel.Panel when click on items in tree.Panel

Load new panel.Panel when click on items in tree.Panel


By : user6466508
Date : March 29 2020, 07:55 AM
may help you . I'm new in ExtJS I need load new panel every time when I click on item in tree.Panel , This code solved problem
code :
treePanel.getSelectionModel().on('select', function(selModel, record) {
    if (record.get('leaf')) {
        Ext.getCmp('content-panel').layout.setActiveItem(record.getId() + '-area');
    }
});
Load panel content after page load

Load panel content after page load


By : Reza208
Date : March 29 2020, 07:55 AM
may help you . Use p:remoteCommand to create some Ajaxified Javascript which will be executed when body is loaded:
code :
<h:body onload="loadWidgets()">
    <!-- content --> 
    <p:remoteCommand name="loadWidgets" 
        update="#{widget.widgetid}" 
        actionListener="#{dashboardOptionsMB.initWidgets}"/>  
</h:body>
<p:remoteCommand name="loadWidgets" 
    update="#{widget.widgetid}" 
    actionListener="#{dashboardOptionsMB.initWidgets}"
    autoRun="true"/>  
Php/Jquery/Ajax: On Accordian Click, it loads content within the page within Accordian

Php/Jquery/Ajax: On Accordian Click, it loads content within the page within Accordian


By : smarvel
Date : March 29 2020, 07:55 AM
this one helps. You could try to create different files with the content of each tab, then on each tab link onclick event use jquery('#').load(), to load the content only when the tab is select.
Are you using plane old php or a PHP framework? Which?
Accordian div Pops up on page load

Accordian div Pops up on page load


By : user0803
Date : March 29 2020, 07:55 AM
around this issue I'm trying to use accordian to create my page. It works fine when I click the button but the only problem is that the div comes open on page load and I want it to be closed. It should only open when the button is clicked. , Simply add style="display:none" to your pannel div
Change
code :
 <div class="panel" id="AccordionDiv">
 <div class="panel" id="AccordionDiv" style="display:none">
Related Posts Related Posts :
  • es lint '' is assigned a value but never used' eventhough i have used it
  • Can "name" attribute be used for custom VueJS components
  • Get innerHTML of content when it is clicked
  • HTTPS causes CSS animations to not load? Very confused
  • How to hide other div apart from touched div to the band
  • Is global variable assignment atomic on NodeJS?
  • Datepicker onchangemonthyear beforeshowday
  • trying to render html files using jade but it still adresses it as a jade
  • Google Analytics - Understanding and Dissecting the Snippet: What is | | [ ];
  • Replacing "[aA09.b]." to "[aA09.b]\n" in in JavaScript
  • Why wrap a function definition in an immediate function?
  • Enable / disable jQuery script on switching to different tab in a HTML page
  • how can find return variable value outside anonymous function in node js mysql query function
  • Converting 1 to 0001 in javascript array
  • svg viewbox should not resize the text fontSize?
  • store newline character with string in a variable
  • MP4 videos in Flowplayer does not play in Windows 7 Chrome
  • jquery focusin event not firing
  • How to debug Vue application with google chrome
  • html 5 web app cache download complete javascript alert?
  • Ember.js setupController fired only once
  • How to validate a currency input
  • How to convert my Array of data to key & value pair
  • Statistics circles in CSS
  • So I wanted to make a trig solver in javascript?
  • Showing HighCharts series name on x-axis and in legend
  • In Rails, how can we pass parameters in script?
  • Build Fails: `npm rebuild node-sass --force`
  • Angular Datepicker change dateformat
  • Trying to extract data from between two sets of characters
  • Configuring Jest in WebStorm
  • Uncaught Error: Syntax error, unrecognized expression: tr.ec_portfolio_title,
  • JQuery fading in fading out continuously
  • Unexpected end of input (Line 1) and Undefined Function?
  • How to animate the width of a div slowly with jquery
  • JavaScript + RegEx Complications- Searching Strings Not Containing SubString
  • SignalR - Unable to get property 'client' of undefined or null reference
  • full calendar not displaying when loaded (with backbone)
  • Angular: Update service and share data between controllers
  • ReplaceAll Google script
  • Search for matching LI items in separate UL
  • Access arguments of an... argument
  • Customizing Google custom search jsapi (query strings)
  • React | Can´t load Images > Module not found
  • Dynamically creating buttons in DOJO
  • 404 Not Found in AJAX post call
  • How do I find out, using javascript, what software opened and running my application?
  • Javascript to check the status of wireless connection
  • StarDict support for JavaScript and a Firefox OS App
  • Phonegap event Resume
  • call javascript function on ENTER key press?
  • When is the best time to remove no-js classes from the html tag
  • Recommended email sending languages
  • setInterval not working properly with chrome
  • Does IE create new scope for each script tag?
  • Uncaught SyntaxError: Unexpected token < Underscore and parse issues
  • How to pass captured URL to Email Body in HTML
  • How to structure default nested resources?
  • Store all the keys of a JSON object in a variable
  • Need an efficient way to group the Array of object in javascript
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org