SmartWizard vertical style - smart-wizard

I am using jquery SmartWizard control and want to show the toolbar vertically with the content for each tab to the right.However hen I run the below code, I get the error 'Element not found .nav'. What am I doing wrong? Any help is appreciated. Is it possible to make smartwizard show vertically with tab content to the side.
#model ApplicationViewModel
<div id="smartwizard">
<h3>Application</h3>
<div class="row">
<div class="col-3">
<ul class="nav flex-column nav-pills">
<li>
<a class="nav-link" href="#step-1">
Personal Information
</a>
</li>
<li>
<a class="nav-link" href="#step-2">
Education
</a>
</li>
<li>
<a class="nav-link" href="#step-3">
Professional Experience
</a>
</li>
<li>
<a class="nav-link" href="#step-4">
Business and Finanical Information
</a>
</li>
</ul>
</div>
<div class="col-9">
<div class="tab-content">
<div id="step-1" class="tab-pane" role="tabpanel">
<partial name="_PersonalInfo" model="Model" />
</div>
<div id="step-2" class="tab-pane" role="tabpanel">
Education
</div>
<div id="step-3" class="tab-pane" role="tabpanel">
Professional Experience
</div>
<div id="step-4" class="tab-pane" role="tabpanel">
Business and Finanical Information
</div>
</div>
</div>
</div>
</div>
#section scripts{
<script>
$(document).ready(function () {
// SmartWizard initialize
$('#smartwizard').smartWizard({
toolbarSettings: {
toolbarButtonPosition: 'right', // left, right, center
showNextButton: true, // show/hide a Next button
showPreviousButton: false, // show/hide a Previous button
toolbarExtraButtons: [$('<button></button>').text('Save')
.addClass('btn btn-info')
] // Extra buttons to show on toolbar, array of jQuery input/buttons elements
}
});
});
</script>
}

Related

Bootstrap 4 tabs with VuesJS in a loop - can't go back to the first tab

I am using vueJS and Bootstrap tabs and can't get them to work properly. I can visit tab 1, tab 2, tab 3, tab 4, but then I can't go back to tab 1.
I can also go 1, 3, but then not 1 and 2. I can basically only go to the right
As these tabs are in a v-for loop, I add ids to each of them.
I have zero error/warning, each ID is unique.
<nav class="navbar navbar-expand-lg " style="width:100%;">
<div class=" navbar-collapse">
<ul class="navbar-nav mr-auto mt-2 mt-lg-0" :id="'myTab'+form.id_item" role="tablist" style="display: flex; width:100%">
<li class="nav-item nav-evt-li">
<a class="nav-link nav-evt-a active" :id="'infosGenform-tab'+form.id_item" data-toggle="tab" :href="'#infosGenform'+form.id_item" role="tab" aria-controls="infosGenform" aria-selected="true">infosGenform</a>
</li>
<li class="nav-item nav-evt-li">
<a class="nav-link nav-evt-a " :id="'inscrform-tab'+form.id_item" data-toggle="tab" :href="'#inscrform'+form.id_item" role="tab" aria-controls="inscrform" aria-selected="true">inscrform</a>
</li>
<li class="nav-item nav-evt-li">
<a class="nav-link nav-evt-a" :id="'machineform-tab'+form.id_item" data-toggle="tab" :href="'#machineform'+form.id_item" role="tab" aria-controls="machineform" aria-selected="true">machineform</a>
</li>
<li class="nav-item nav-evt-li">
<a class="nav-link nav-evt-a " :id="'comform-tab'+form.id_item" data-toggle="tab" :href="'#comform'+form.id_item" role="tab" aria-controls="home" aria-selected="true">comform</a>
</li>
</ul>
</div>
</nav>
<div class="tab-content" :id="'myTabContent'+form.id_item">
<div class="tab-pane fade show active itra-light-grey-bgr" :id="'infosGenform'+form.id_item" role="tabpanel" aria-labelledby="infosGenform-tab">
1
</div>
<div class="tab-pane fade show itra-light-grey-bgr" :id="'inscrform'+form.id_item" role="tabpanel" aria-labelledby="inscrform-tab">
2
</div>
<div class="tab-pane fade show itra-light-grey-bgr" :id="'machineform'+form.id_item" role="tabpanel" aria-labelledby="machineform-tab">
3
</div>
<div class="tab-pane fade show itra-light-grey-bgr" :id="'comform'+form.id_item" role="tabpanel" aria-labelledby="comform-tab">
4
</div>
</div>
Is it something you already experienced?
Thanks a lot
I would avoid using jQuery and use vuejs instead to navigate tabs. Here is my approach.
In your tab navigation add this #click.prevent="showTab(1)". The .prevent is to prevent default action of going to another page. In your other navigation do the same i.e #click.prevent="showTab(n)".
This means you will have to add a new vuejs method showTab(value)like below.
showTab(value){
this.tab = value
}
In your tab content use vuejs show v-show="tab == 1" Find the full code below.
<template>
<div>
<nav class="navbar navbar-expand-lg " style="width:100%;">
<div class=" navbar-collapse">
<ul class="navbar-nav mr-auto mt-2 mt-lg-0" :id="'myTab'+form.id_item" role="tablist" style="display: flex; width:100%">
<li class="nav-item nav-evt-li">
<a class="nav-link nav-evt-a active" :id="'infosGenform-tab'+form.id_item" #click.prevent="showTab(1)" role="tab" aria-controls="infosGenform"
aria-selected="true">infosGenform</a>
</li>
<li class="nav-item nav-evt-li">
<a class="nav-link nav-evt-a " :id="'inscrform-tab'+form.id_item" #click.prevent="showTab(2)" role="tab" aria-controls="inscrform"
aria-selected="true">inscrform</a>
</li>
<li class="nav-item nav-evt-li">
<a class="nav-link nav-evt-a" :id="'machineform-tab'+form.id_item" #click.prevent="showTab(3)" role="tab" aria-controls="machineform"
aria-selected="true">machineform</a>
</li>
<li class="nav-item nav-evt-li">
<a class="nav-link nav-evt-a " :id="'comform-tab'+form.id_item" #click.prevent="showTab(4)" role="tab" aria-controls="home"
aria-selected="true">comform</a>
</li>
</ul>
</div>
</nav>
<div class="tab-content" :id="'myTabContent'+form.id_item">
<div v-show="tab == 1" class="tab-pane fade show itra-light-grey-bgr" :id="'infosGenform'+form.id_item" role="tabpanel"
aria-labelledby="infosGenform-tab">
1
</div>
<div v-show="tab == 2" class="tab-pane fade show itra-light-grey-bgr" :id="'inscrform'+form.id_item" role="tabpanel"
aria-labelledby="inscrform-tab">
2
</div>
<div v-show="tab == 3" class="tab-pane fade show itra-light-grey-bgr" :id="'machineform'+form.id_item" role="tabpanel"
aria-labelledby="machineform-tab">
3
</div>
<div v-show="tab == 4" class="tab-pane fade show itra-light-grey-bgr" :id="'comform'+form.id_item" role="tabpanel"
aria-labelledby="comform-tab">
4
</div>
</div>
</div>
</template>
<script>
export default {
data(){
return {
tab: 1
}
},
methods: {
showTab(value){
this.tab = value
}
}
}
</script>
I hope this answer will help.

Is it possible to prevent the Bootstrap carousel play only on mouse hover?

is it possible to make Bootstrap 4 Carousel to play ONLY on hover? Like normally it's a still image, but on mousehover it starts to cycle the carousel and on mouseout it pauses.
slider.html
<div id="carousel-example-generic" class="carousel slide carousel-fade slider slideInUp"
data-ride="carousel">
<div class="row">
<div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
<div class="tab-section">
<div class="user">
<ul class=" carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0"
class="active wow slideInUp " data-wow-delay=".1s">
<a href="" class="transition-fast">
<span class="count">01</span>
<span class="text">
Lorem Lopsun
</span>
</a>
</li>
<li data-target="#carousel-example-generic" data-slide-to="1" class=" wow slideInUp"
data-wow-delay=".2s">
<a href="" class="transition-fast">
<span class="count">02</span>
<span class="text">
Lorem Lopsun
</span>
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="col-lg-5 col-md-6 wow slideInRight" data-wow-delay="1s">
<div class="carousel-inner wow slideInUp" data-wow-delay="2s" role="listbox">
<div class="item active">
<img src="assets/img/first-01.png" alt="">
</div>
<div class="item">
<img src="assets/img/first-02.png" alt="">
</div>
</div>
</div>
</div>
</div>
script.js
$('#carousel-example-generic').hover(function(){
$("#carousel-example-generic").carousel('cycle');
},function(){
$("#carousel-example-generic").carousel('pause');
});
First disable the default behaviour of the carousel to stop on hover by putting setting the data-pause to false
id="carousel-example-generic" class="carousel slide carousel-fade slider slideInUp" data-pause="false"
Use the following js to manage the hover behaviour
$('.carousel').carousel({
interval: 2000
})
$('.carousel').carousel('pause') ;
$('.carousel').hover(function(){
$('.carousel').carousel('cycle') ;
}) ;
$('.carousel').mouseleave(function(){
$('.carousel').carousel('pause') ;
});

Bootstrap4 nav-item issue

I am movig a project from Bootstrap 3 to Bootstrap 4...
the following code was working fine w Bootstrap 3 , but it's not with Bootstrap 3...
here is the jsFiddle test and the html code
Boostrap3 behavior :
initial button 1 is active
when the user click on one of the 3 buttons, it displays the corresponding tab. And the button is raised up, the other buttons stay down.
Boostrap 4 behavior :
initial button 1 is active
when the user click on one of the 3 buttons, it displays the corresponding tab. And the button is raised up, the other buttons never go down.. they stay active...
<section id="memberships" class="memberships">
<div class="container">
<div class="row d-flex justify-content-center">
<div class="col-lg-8 text-center">
<h2 class="header-text">TEST</h2>
<div class="memberships-mockup">
<div id="nav-tabContent" class="tab-content">
<div id="nav-first" role="tabpanel" aria-labelledby="nav-first-tab" class="tab-pane fade show active"><p>1111111111</p></div>
<div id="nav-second" role="tabpanel" aria-labelledby="nav-second-tab" class="tab-pane fade"><p>2222222222</p></div>
<div id="nav-third" role="tabpanel" aria-labelledby="nav-third-tab" class="tab-pane fade"><p>3333333333</p></div>
</div>
</div>
</div>
</div>
<div id="myTab" role="tablist" class="nav nav-tabs">
<div class="row">
<div class="col-sd-4">
<a id="nav-first-tab" data-toggle="tab" href="#nav-first" role="tab" aria-controls="nav-first" aria-expanded="true" class="nav-item nav-link active"><span class="number">1</span></a>
</div>
<div class="col-sd-4">
<a id="nav-second-tab" data-toggle="tab" href="#nav-second" role="tab" aria-controls="nav-second" class="nav-item nav-link"><span class="number">2</span></a>
</div>
<div class="col-sd-4">
<a id="nav-third-tab" data-toggle="tab" href="#nav-third" role="tab" aria-controls="nav-third" class="nav-item nav-link"><span class="number">3</span></a>
</div>
</div>
</div>
</div>
</section>
If you want the nav-tabs behavior to work properly in Bootstrap 4, each tab should be a direct sibling, not in separate columns.
https://www.codeply.com/go/Wu5OKQvDiQ
<div id="myTab" role="tablist" class="nav nav-tabs">
<a id="nav-first-tab" data-toggle="tab" href="#nav-first" role="tab" aria-controls="nav-first" aria-expanded="true" class="nav-item nav-link active"><span class="number">1</span></a>
<a id="nav-second-tab" data-toggle="tab" href="#nav-second" role="tab" aria-controls="nav-second" class="nav-item nav-link"><span class="number">2</span></a>
<a id="nav-third-tab" data-toggle="tab" href="#nav-third" role="tab" aria-controls="nav-third" class="nav-item nav-link"><span class="number">3</span></a>
</div>

Uncaught ReferenceError: Bus is not defined in Spark Laravel

I was trying to move the some functionality which is the Drop down of the Laravel Spark at the NavBar to my app.blade.php .
my code looks like this
<body class="skin-1">
<!-- Wrapper-->
<div id="spark-app" v-cloak>
<!-- Navigation -->
#include('layouts.wf_navigation')
<!-- Page wraper -->
<div id="page-wrapper" class="gray-bg">
<!-- Main view -->
#yield('content')
<!-- Footer -->
#include('layouts.footer')
</div>
<!-- End page wrapper-->
</div>
<!-- End wrapper-->
#show
<script src="/js/app.js"></script>
but I am getting an error
Uncaught ReferenceError: Bus is not defined
the error is referencing to this line of code in APp.js
Bus.$on('updateUser', function () {
self.getUser();
})
UPDATE
The Bus variable is defined in the App.js itself the code looks like this
if (window.Vue === undefined) {
window.Vue = __webpack_require__(287);
window.Bus = new Vue();
}
note: the previous issue got fixed by removing the the extra Vuejs file which was included in the top of my app.blade.php
Update 1
There is new error
[Vue warn]: Templates should only be responsible for mapping the state
to the UI. Avoid placing tags with side-effects in your templates,
such as .
the templates which are being included are
wf_navigation.blade.php
<div class="row border-bottom">
<nav class="navbar navbar-static-top white-bg" role="navigation" style="margin-bottom: 0">
<div class="navbar-header">
<a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="fa fa-bars"></i> </a>
<form role="search" class="navbar-form-custom" method="post" action="/">
<div class="form-group">
<input type="text" placeholder="Search for something..." class="form-control" name="top-search" id="top-search" />
</div>
</form>
</div>
<ul class="nav navbar-top-links navbar-right">
<?php $currentTeam = auth()->user()->currentTeam; ?>
#if($currentTeam)
<li>
<a href="" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
{{ $currentTeam->name }}
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
Profile
</li>
<li>
Members
</li>
<li>
Subscription
</li>
<li>
Invoices
</li>
#include('spark::nav.teams')
</ul>
</li>
#endif
</ul>
</nav>
</div>
Which is calling #include('spark::nav.teams')
the teams.blade.php looks like this
<li class="dropdown-header">{{ ucfirst(str_plural(Spark::teamString())) }}</li>
<!-- Create Team -->
#if (Spark::createsAdditionalTeams())
<li>
<a href="/settings#/{{str_plural(Spark::teamString())}}">
<i class="fa fa-fw fa-btn fa-plus"></i>Create {{ ucfirst(Spark::teamString()) }}
</a>
</li>
#endif
<!-- Switch Current Team -->
#if (Spark::showsTeamSwitcher())
<li v-for="team in teams">
<a :href="'/{{ str_plural(Spark::teamString()) }}/'+ team.id +'/switch'">
<span v-if="user.current_team_id == team.id">
<i class="fa fa-fw fa-btn fa-check text-success"></i>#{{ team.name }}
</span>
<span v-else>
<img :src="team.photo_url" class="spark-team-photo-xs"><i class="fa fa-btn"></i>#{{ team.name }}
</span>
</a>
</li>
#endif
<li class="divider"></li>
'footer.blade.php'
<div class="footer">
<div class="pull-right">
V4.0
</div>
<div>
<strong>Powered By</strong> Energy Engine © 2010-2017
</div>
</div>
I am new to vue so no idea whats happening there

Menu Toggle Breaks everything when in xs.

When I get to the xs (Phone version) and press the Toggle Menu button it breaks the whole layout and the carousel rides on top of everything.
This is the Simple Sidebar
Simple Sidebar - Start Bootstrap Template
<body>
<div id="wrapper">
<!-- Sidebar -->
<div id="sidebar-wrapper">
<ul class="sidebar-nav">
<li class="sidebar-brand">
RFA
</li>
<li>
BIO
</li>
<li>
Contact
</li>
<li>
Cadre
</li>
<li>
Store
</li>
<li>
Conferences
</li>
</ul>
</div>
<!-- /#sidebar-wrapper -->
<!-- Page Content -->
<div id="page-content-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-lg-12">
<h1 class="col-xs-12">Robin Fogarty and Associates</h1>
<img src="images/RFA_circles.png" alt="RFA" class="img-responsive rfa" title="Robin Fogarty and Associates">
<p>For the past 15 years Robin Fogarty and Associates has been a publisher and leading experts on staff development design for Skylight Publishing .</p>
Toggle Menu
</div>
</div>
</div>
</div>
<div id="carousel1" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carousel1" data-slide-to="0" class="active"> </li>
<li data-target="#carousel1" data-slide-to="1"></li>
<li data-target="#carousel1" data-slide-to="2"></li>
</ol>
<div class="carousel-inner" role="listbox">
<div class="item active"><img src="images/Rote&Spatial_color.png" alt="First slide image" class="center-block">
<div class="carousel-caption">
<h3>First slide Heading</h3>
<p>First slide Caption</p>
</div>
</div>
<div class="item"><img src="images/WalikingwithDaisy_color.png" alt="Second slide image" class="center-block">
<div class="carousel-caption">
<h3>Second slide Heading</h3>
<p>Second slide Caption</p>
</div>
</div>
<div class="item"><img src="images/Poster.png" alt="Third slide image" class="center-block">
<div class="carousel-caption">
<h3>Third slide Heading</h3>
<p>Third slide Caption</p>
</div>
</div>
</div>
<a class="left carousel-control" href="#carousel1" role="button" data-slide="prev"><span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span><span class="sr-only">Previous</span></a><a class="right carousel-control" href="#carousel1" role="button" data-slide="next"><span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span><span class="sr-only">Next</span></a></div>
<!-- /#page-content-wrapper -->
<!-- /#wrapper -->
<!-- jQuery -->
<!-- <script src="js/jquery.js"></script> -->
<script src="js/jquery-1.11.2.min.js" type="text/javascript"></script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script> <!-- Menu Toggle Script -->
<script>
$("#menu-toggle").click(function(e) {
e.preventDefault();
$("#wrapper").toggleClass("toggled");
});
</script>
Wrap your carousel in a row, apply this CSS
.carousel-wrap{
margin-top: 50px;
}
CODEPEN DEMO