Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bootstrap3
#76
Change carousel animation speed and slide interval

i tried to slow down the animation speed and the interval between the slides in bootstrap.js but was unsuccessful.
what i did so far:
on line 305, Carousel.DEFAULTS, i changed the interval value from 5000 to 10000.
on line 421, i changed the value from 1000 to 5000.

PHP Code:
.emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000


on line 571 i changed the value from 350 to 3500.

PHP Code:
.emulateTransitionEnd(350)[dimension](this.$element[0][scrollSize]) 

all these modifications did not have any effect on the carousel behaviour.


does anybody know what to do to slow down animation and interval in the carousel?
Reply
#77
Hi. I'm trying to put some sections of the template in full width, although i try some options i didn't achieve this goal. I think maybe in the code there is some line or something that block this. Or maybe i didn't do it properly.
Reply
#78
Whats the code snippet to automatically replace Home text from navbar with home icon, like house?. Tongue
Reply
#79
Edit the theme's functions.php file and just after this line
Code:
function AddPageToNavigation_bootstrap($page, $currentpage, $pagesSorted, $level) {
insert this:
Code:
if ($page['url'] == 'index') $page['menu'] = '<i class="glyphicon glyphicon-home"></i>';
Reply
#80
Thanx that works Big Grin
Reply
#81
First, sorry for my bad english.

I cant open the child of a child menue (third-level-children). If i click his parent the menue close and nothing happens.

Can anybody help a beginner?
Reply
#82
As far as i know, boostrap3 only supports 2 levels.
(Bootstrap2 did support more than 2 however)
Reply
#83
It should work like this example 

http://bootstrap3.randm.ca/child-with-ch...vel-child/

but it dosnt.
Reply
#84
No idea.
I can only suggest you try the version available in the github repository, https://github.com/rickparrish/Bootstrap3 , that seems to be newer than the one in Extend.
Reply
#85
yes i tried this version from github too, but the problem was the same
Reply
#86
I find a little solution. On Bootstrap3.css was one row as comment.

/*.dropdown-submenu:hover>.dropdown-menu{display:block;}*/

I delete the comment sign, now it works with hover. Its not like the example but it works a little. But dont know how it is with touch.
Reply
#87
Now i tryed to use the javascript from this example side

http://bootstrap3.randm.ca/child-with-ch...vel-child/

but it dont work. How can it be? I think the problem can only be from javascript. If it works on this example side, it must work too on my side.
Reply
#88
NOW I HAVE THE SOLUTION!

I must activate in the Bootstrap3 Plugin the option "display other themes". Than it works how it should. I dont want activate it. So i think its a bug.
Reply
#89
Here is the right working footer.inc.php. It works with or without displayed selection for other themes.

Code:
<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); }
/****************************************************
*
* @File:      footer.inc.php
* @Package:   GetSimple
* @Action:    Bootstrap3 for GetSimple CMS
*
*****************************************************/
?>
    
 <hr>

      <footer>
        <p>Bootstrap3 for GetSimple CMS by <a href="http://www.rickparrish.ca">Rick Parrish</a> of <a href="http://www.randm.ca">R&amp;M Software</a> - <?php get_site_credits(); ?></p>
      </footer>

    </div> <!-- /container -->
    
    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
   <!-- <script src="<?php get_theme_url(); ?>/js/jquery-3.3.1.min.js"></script> -->
    <script src="<?php get_theme_url(); ?>/js/jquery.cookie.js"></script>
    <script src="<?php get_theme_url(); ?>/js/jquery.tablesorter.min.js"></script>
    <script src="<?php get_theme_url(); ?>/js/bootstrap.min.js"></script>
    <script>
      if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
        var msViewportStyle = document.createElement("style")
        msViewportStyle.appendChild(
          document.createTextNode(
            "@-ms-viewport{width:auto!important}"
          )
        )
        document.getElementsByTagName("head")[0].appendChild(msViewportStyle)
      }
    </script>

    <?php
      if ($ThemeSettings->DisplayOtherThemes == "true") {
    ?>
          <script type="text/javascript">
          $(document).ready(function() {
            // If user selected a theme, load it
            if ($.cookie("theme")) {
              $("link.SelectedTheme").attr("href", $.cookie("theme"));
              HighlightTheme($.cookie("theme"));
            }

            // If user selected a navbar inversion, load it
            if ($.cookie("invert")) {
              if ($.cookie("invert") == "true") {
                $('#chkInvertNavigationBar').attr('checked','checked');
                SetInvert(true);
              } else {
                $('#chkInvertNavigationBar').removeAttr('checked');
                SetInvert(false);
              }
            }

            // User is selecting a new theme
            $("#ThemesMenu li a").click(function() {
              $("link.SelectedTheme").attr("href", $(this).attr('rel'));
              $.cookie("theme", $(this).attr('rel'), {expires: 365, path: '/'});
              HighlightTheme($.cookie("theme"));
              return false;
            });

            // User is selecting a new navbar inversion
            $("#chkInvertNavigationBar").change(function() {
              if (this.checked) {
                $.cookie("invert", "true", {expires: 365, path: '/'});
                SetInvert(true);
              } else {
                $.cookie("invert", "false", {expires: 365, path: '/'});
                SetInvert(false);
              }
            });

            // Prevent the menu from disappearing when selecting a navbar inversion
            $('.dropdown-menu input, .dropdown-menu label').click(function(e) {
              e.stopPropagation();
            });
            
            // Allow sub menus
            // From http://stackoverflow.com/a/19076934/342378
            $('ul.dropdown-menu [data-toggle=dropdown]').on('click', function(event) {
              // Avoid following the href location when clicking
              event.preventDefault(); 
              // Avoid having the menu to close when clicking
              event.stopPropagation(); 
              // Store old class
              var OldClass = $(this).parent().attr("class");
              // Close all menus
              $('ul.dropdown-menu [data-toggle=dropdown]').parent().removeClass('open');
              // Restore old class
              $(this).parent().attr("class", OldClass);
              // Toggle the class to show or hide it
              $(this).parent().toggleClass('open');

              var menu = $(this).parent().find("ul");
              var menupos = $(menu).offset();

              if (menupos.left + menu.width() > $(window).width()) {
                  var newpos = -$(menu).width();
                  menu.css({ left: newpos });    
              } else {
                  var newpos = $(this).parent().width();
                  menu.css({ left: newpos });
              }
            });

          });
          
          function HighlightTheme(url) {
            $("#ThemesMenu li.current").attr("class", "");
            $("#ThemesMenu li a[rel='" + url + "']").parent().attr("class", "current active");
          }
          
          function SetInvert(invert) {
            if (invert) {
              $("#NavBar").removeClass("navbar-default").addClass("navbar-inverse");
            } else {
              $("#NavBar").addClass("navbar-default").removeClass("navbar-inverse");
            }
          }
        </script>
    <?php
      } else {
      ?>
      <script type="text/javascript">
                            
          $(document).ready(function() {           

            // Prevent the menu from disappearing when selecting a navbar inversion
            $('.dropdown-menu input, .dropdown-menu label').click(function(e) {
              e.stopPropagation();
            });
            
            // Allow sub menus
            // From http://stackoverflow.com/a/19076934/342378
            $('ul.dropdown-menu [data-toggle=dropdown]').on('click', function(event) {
              // Avoid following the href location when clicking
              event.preventDefault(); 
              // Avoid having the menu to close when clicking
              event.stopPropagation(); 
              // Store old class
              var OldClass = $(this).parent().attr("class");
              // Close all menus
              $('ul.dropdown-menu [data-toggle=dropdown]').parent().removeClass('open');
              // Restore old class
              $(this).parent().attr("class", OldClass);
              // Toggle the class to show or hide it
              $(this).parent().toggleClass('open');

              var menu = $(this).parent().find("ul");
              var menupos = $(menu).offset();

              if (menupos.left + menu.width() > $(window).width()) {
                  var newpos = -$(menu).width();
                  menu.css({ left: newpos });    
              } else {
                  var newpos = $(this).parent().width();
                  menu.css({ left: newpos });
              }
            });

          });
          
          
        </script>
        <?php
      }
      

      if ($ThemeSettings->TrackingId != "") {
    ?>

      <script>
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

          ga('create', '<?php echo $ThemeSettings->TrackingId; ?>', 'auto');
          ga('send', 'pageview');

        </script>  
    
    <?php
      }
    ?>
            
    <?php get_footer(); ?>
  </body>
</html>
Reply




Users browsing this thread: 1 Guest(s)