how to close left side menu from code in a intel xdk hybrid app using appframework 3 - hybrid-mobile-app

after navigate to a subpage i would like to close the left menu, but the app throw the "uib_sb is not defined".
how do i close the menu?
this the code to navigate:
$(document).on("click", ".uib_w_5", function(evt)
{
activate_subpage("#page_83_54");
uib_sb.close_all_sidebars();
});
this is the menu:
<nav class="af-sidemenu outer-element uib_w_2" data-side="left" id="uib_w_2" data-uib="app_framework/side_menu_area" data-ver="2">
<div class="view active">
<header class="container-group outer-element uib_w_3" data-uib="app_framework/header" data-ver="3" id="af-header-1">
<h1>Prova</h1>
<div class="widget-container wrapping-col single-centered"></div>
<div class="widget-container content-area horiz-area wrapping-col header-left"></div>
<div class="widget-container content-area horiz-area wrapping-col header-right"></div>
</header>
<div class="pages">
<div class="panel active">
<div class="col uib_col_1 single-col" data-uib="layout/col" data-ver="0">
<div class="widget-container content-area vertical-col">
<ul class="list widget uib_w_4 d-margins" data-uib="app_framework/listview" data-ver="2">
<li class="widget uib_w_5" data-uib="app_framework/listitem" data-ver="2"><a>ricerca per produttore</a>
</li>
<li class="widget uib_w_6" data-uib="app_framework/listitem" data-ver="2"><a>ricerca per scheda</a>
</li>
</ul>
<span class="uib_shim"></span>
</div>
</div>
</div>
</div>
</div>
</nav>

i found this:
$.afui.drawer.hide ("#uib_w_2", "left");

Related

Masonry not working with bootstrap 5 and angular 13

I have freshly implemented masonry on my website(https://mypleaks.com) along bootstrap 5 and angular 13.
I have referred example from https://getbootstrap.com/docs/5.1/examples/masonry/ and added <script src="https://cdn.jsdelivr.net/npm/masonry-layout#4.2.2/dist/masonry.pkgd.min.js" integrity="sha384-GNFwBvfVxBkLMJpYMOABq3c+d3KnQxudP/mGPkzpZSTYykLBNsZEnG2D9G/X/+7D" crossorigin="anonymous" async></script>
I have created cards dynamically like below :
<div class="container-lg content-container mt-lg-5 pr-lg-3 pl-lg-3 pt-lg-2 mt-3 p-0">
<div class="row" data-masonry='{"percentPosition": true }' style="position: relative; height: 1068px;">
<div class="col-sm-6 col-lg-4 mb-4" *ngFor="let content of contentList">
<div class="card" [class.remove-card-border]="content.contentType === advertisement">
<img *ngIf="content.attachments" [src]="content.attachments[0].identifier" class="card-img-top">
<div *ngIf="content.contentType != advertisement" class="card-body">
<h5 class="card-title">{{ content.title }}</h5>
<p class="card-text">{{ content.contentText }} <a [href]="content.externalUrl" class="text-nowrap" target="_blank">read more</a></p>
<div class="btn-toolbar d-flex justify-content-center" role="toolbar" aria-label="Toolbar with button groups">
<div class="btn-group mr-3 input-group" role="group" aria-label="First group" ngbTooltip="good enough, people should know">
<button type="button" [disabled]="evaluationClicked" class="btn btn-success" placement="top"
(click)="upVote(content); evaluationClicked = true;"><i class="fa fa-thumbs-up" aria-hidden="true"></i></button>
<div class="input-group-prepend">
<div class="input-group-text">{{content.promoteCount}}</div>
</div>
</div>
<div class="btn-group ml-3 input-group" role="group" aria-label="Second group" ngbTooltip="fake or not good enough">
<div class="input-group-prepend">
<div class="input-group-text">{{content.rejectCount}}</div>
</div>
<button type="button" [disabled]="evaluationClicked" class="btn btn-danger" placement="top"
(click)="downVote(content); evaluationClicked = true;"><i class="fa fa-thumbs-down fa-flip-horizontal" aria-hidden="true"></i></button>
</div>
</div>
</div>
<div *ngIf="content.contentType === advertisement" class="d-flex justify-content-center">
<app-google-ads></app-google-ads>
</div>
</div>
</div>
</div>
</div>
Somehow, Style not updating on myPleaks similar to bootstrap example, Refer below snippets
bootstrap example
Thanks in advance for any help.
Instead using masonry-layout directly, I used ngx-masonry. Following are the package.json dependencies. And refer the documentation here
"masonry-layout": "^4.2.2",
"ngx-masonry": "^13.0.0"
Add following modules in app.module.ts
Wrap dynamic code in tag <ngx-masonry [options]="myOptions"> and add following config in the component implementation.
public myOptions: NgxMasonryOptions = {
gutter: 10};

wp-bootstrap-nav walker collapse is not working on ipad

Bootstrap navbar collapse is not working. The issue is that it shows a collapsing menu but on click, it is not collapsed.
I have provided my full code so that it can help you to suggest or help me to sort out the issue
<header class="head-image">
<nav id="nav-top" class="navbar hidden-xs hidden-sm" style="margin-bottom: 0px;">
<div class="container text-center">
<div class="col-md-4 col-md-offset-8">
<div class="search-box">
<?php echo do_shortcode('[smart_search id="1"]'); ?>
</div>
</div>
</div>
</nav>
<section id="main-header">
<div class="container">
<div class="pull-left">
<a href="<?php echo esc_url(home_url('/')); ?>" title="<?php echo esc_attr(get_bloginfo('name', 'display')); ?>" rel="home">
<img src="<?php header_image(); ?>" width="213" height="117" alt="">
</a>
</div>
<div class="pull-right hidden-xs hidden-sm">
<div class="row text-right">
<div class="col-xs-12">
<span class="text-white">Order hotline</span>
</div>
<div class="col-xs-12">
<span class="nav-phone">
<i class="fa fa-phone" aria-hidden="true"></i>
<a class="text-white nav-phone" href="tel:+"></a>
</span>
</div>
</div>
<div class="row n-m hidden-xs hidden-sm">
<div class="col-sm-6 col-xs-12 border-brown relative">
<div class="col-xs-3">
<i class="fa fa-user" aria-hidden="true"></i>
</div>
<div class="col-xs-9">
<div class="row">
Login/Register </div>
<div class="row ">
<span class="text-white">
My Account
</span>
</div>
</div>
</div>
<div class="col-sm-5 col-xs-12 border-brown relative">
<div class="col-xs-3">
<a href="<?php echo wc_get_cart_url(); ?>">
<i class="fa fa-shopping-bag" aria-hidden="true"></i>
</a>
</div>
<div class="col-xs-9">
<div class="row">
Shopping bag
</div>
<div class="row">
<span class="text-white">
<?php echo WC()->cart->get_cart_contents_count(); ?> Items <span class="price">(<?php echo WC()->cart->get_cart_total(); ?>)
</span>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<nav class="navbar" id="main-menu">
<div class="container">
<div class="navbar-header hidden-md hidden-lg">
<div class="col-xs-6">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="text-white hidden-lg hidden-md" data-toggle="collapse" data-target="#main-menu-collapse">Menu</span>
</div>
<div class="col-xs-6 pull-right border-brown text-center hidden-lg hidden-md relative">
<div class="row">
<div class="col-xs-4">
<i class="fa fa-shopping-bag" aria-hidden="true"></i>
</div>
<div class="col-xs-8 text-white">
<span class="text-white">
<?php echo WC()->cart->get_cart_contents_count(); ?> Items
<span class="text-white">
(<?php echo WC()->cart->get_cart_total(); ?>)
</span>
</span>
</div>
</div>
</div>
</div>
<div id="main-menu-collapse" class="collapse navbar-collapse">
<?php
wp_nav_menu(array(
'theme_location' => 'primary',
'depth' => 2,
'container' => 'div',
'menu_class' => 'nav navbar-nav',
'fallback_cb' => 'WP_Bootstrap_Navwalker::fallback',
'walker' => new WP_Bootstrap_Navwalker(),
));
?>
<div class="row border-top hidden-lg hidden-md">
<div class="col-xs-3">
Contact
</div>
<div class="col-xs-9">
<a href="tel:">
<i class="fa fa-phone" aria-hidden="true"></i>
<span class="text-white"></span>
</a>
</div>
</div>
<div class="row border-top hidden-lg hidden-md">
<div class="col-xs-3">
Login/ register
</div>
<div class="col-xs-9">
<a href="<?php echo get_permalink(get_option('woocommerce_myaccount_page_id')); ?>">
<i class="fa fa-user" aria-hidden="true"></i>
<span class="text-white">My account</span>
</a>
</div>
</div>
</div>
</div>
</nav>
<nav class="navbar" id="menu-shortcut">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav col-lg-12 text-center">
<li class="col-lg-4 col-md-4 text-left">text</li>
<li class="col-lg-4 col-md-4">text</li>
<li class="col-lg-4 col-md-4 text-right"><a class="toggle-modal" href="javascript:void(0);">Sign up </a></li>
</ul>
</div>
</div>
</nav>
</header>
I am also using Jquery the code is below, there is no jquery conflict in my code everything working perfectly only getting the issue when I am browsing form iPad
$('#main-menu .navbar-header .col-xs-6:first-child, #main-menu .navbar-header button').click(function()
{
if($(this).children('button').attr('class') == "navbar-toggle collapsed")
{
$(this).parents('.container').children('#main-menu-collapse').addClass('in');
$(this).parents('.container').children('#main-menu-collapse').slideDown('fast', function() {
});
$(this).children('button').html("");
$(this).children('button').css({
'min-width' : '44px',
'min-height' : '34px'
});
$(this).children('button').attr('aria-expanded', 'true');
$(this).children('button').removeClass('collapsed');
}else
{
$(this).children('button').addClass('collapsed');
$(this).parents('.container').children('#main-menu-collapse').slideDown('fast', function() {
});
$(this).parents('.container').children('#main-menu-collapse').css('display', 'none');
$(this).children('button').attr('aria-expanded', 'false');
$(this).parents('.container').children('#main-menu-collapse').removeClass('in');
$(this).children('button').css({
"margin-top" : "11px",
'background' : 'none'
});
$(this).children('button').html('<span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span>');
}
});
.click() does not happen in Safari unless the element it is bound on is a legitimate click event receiver (target) in Apple's own implementation of web standard (which differs from current web standard).
The simplest way to make any element become a "legitimate" click event target is to add
cursor: pointer;
to it.
Other workarounds include using different events, such as touchstart, tap or input, depending on case.
So, in your case, a fix would be to add this to your CSS:
#main-menu .navbar-header .col-xs-6:first-child,
#main-menu .navbar-header button {
cursor: pointer;
}
Or to change the wrapper to:
$('#main-menu .navbar-header .col-xs-6:first-child, #main-menu .navbar-header button')
.on('click touchstart', function(){
// your code here
})
In my opinion, you should remove wordpress, wordpress-theming and wp-nav-walker from the question as they are irrelevant to the bug and perhaps add safari, ios and/or ipad to it.

Jquery How to like switch to next tab in ASP MVC5

I have a view like this
View Code:-
<div class="col-md-3" style="background-color:white" id="Tabs">
<ul class="nav nav-tabs tabs-left">
<li class="active"><a data-toggle="tab" href="#home">Home</a></li>
<li><a data-toggle="tab" href="#menu1">Menu 1</a></li>
</ul>
</div>
<div class="col-md-9 tabs-left" style="background-color:white">
<div class="tab-content">
<div id="home" class="tab-pane fade in active">
<div class="panel-body fixed-panel">
<div class="row">
<div class="col-lg-3">
#Html.DropDownList("List", new SelectList(ViewBag.List, "ListID", "ListDescription"), "Select", new { id = "List1"})
</div>
Continue
</div>
</div>
</div>
<div id="menu1" class="tab-pane fade in active">
<div class="panel-body fixed-panel">
<div class="row">
<div class="col-lg-3">
#Html.DropDownList("List", new SelectList(ViewBag.List, "ListID", "ListDescription"), "Select", new { id = "List1"})
</div>
</div>
</div>
</div>
<div id="menu2" class="tab-pane fade in active">
<div class="panel-body fixed-panel">
<div class="row">
<div class="col-lg-3">
#Html.DropDownList("List", new SelectList(ViewBag.List, "ListID", "ListDescription"), "Select", new { id = "List1"})
</div>
</div>
</div>
</div>
</div>
</div>
"
Jquery To check for validation and close the tab and open the next tab:-
$('.nexttab').click(function (e) {
e.preventDefault();
var sectionValid = true;
section = $(this).closest('.tab-pane.fade');
$.each(section.find('input'), function () {
if (!$(this).valid()) {
sectionValid = false;
}
});
if (sectionValid) {
// collapse current section:
section.collapse('toggle');
// find and uncollapse next section:
section.next().find('.tab-pane.fade').collapse('toggle');
}
});
I have go to close the active tab by "section.collapse('toggle');" however not able to open the next on on clicking the next tab. Any help will be highly appreciated. I am still trying my hands at asp mvc,so i could have missed the obvious.
Try this. I cleaned up the tab markup a bit, wrapped it with a form (required by jquery validate) and used .tab() instead of .collapse().
See http://getbootstrap.com/javascript/#tabs for the relevant documentation.
$('.nexttab').click(function(e) {
e.preventDefault();
var sectionValid = true;
section = $(this).closest('.tab-pane.fade');
sectionValid = section.closest('form').valid();
if (sectionValid) {
// find and uncollapse next section:
$(".nav-tabs .active a").closest("li").next().find("a").tab("show");
}
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://cdn.jsdelivr.net/jquery.validation/1.15.0/jquery.validate.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
<form>
<ul class="nav nav-tabs tabs-left">
<li class="active"><a data-toggle="tab" href="#home">Home</a>
</li>
<li><a data-toggle="tab" href="#menu1">Menu 1</a>
</li>
</ul>
<div class="tab-content">
<div id="home" class="tab-pane fade in active">
<div class="panel-body fixed-panel">
<div class="row">
<div class="col-lg-3">
</div>
Continue
</div>
</div>
</div>
<div id="menu1" class="tab-pane fade in active">
<div class="panel-body fixed-panel">
<div class="row">
<div class="col-lg-3">
</div>
</div>
</div>
</div>
<div id="menu2" class="tab-pane fade in active">
<div class="panel-body fixed-panel">
<div class="row">
<div class="col-lg-3">
</div>
</div>
</div>
</div>
</div>
</form>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
You should be using the .tab('show') instead of .collapse('toggle').

How to show pages on right side with panel in jquery mobile

I am able to implement panel .But i need my pages should display with panel.Actually when i click panel button's then it hide panel .show page on whole screen .But i need to show page with panel.
Here is my code.
http://jsfiddle.net/ravi1989/TXRjk/2/
Jump to second page
Jump to third page
First Page
Next
Open Pannel
<div data-role="page" id="second">
<div data-role="panel" id="mypanel">
Jump to first page
Jump to third page
</div>
<div data-theme="a" data-role="header">
<h3>
Second Page
</h3>
Back
</div>
<div data-role="content">
<a data-role="button" id="open-panel">Open Pannel</a>
</div>
<div data-theme="a" data-role="footer" data-position="fixed">
</div>
</div>
<div data-role="page" id="third">
<div data-role="panel" id="mypanel">
Jump to first page
Jump to second page
</div>
<div data-theme="a" data-role="header">
<h3>
Third Page
</h3>
Back
</div>
<div data-role="content">
<a data-role="button" id="open-panel">Open Pannel</a>
</div>
<div data-theme="a" data-role="footer" data-position="fixed">
</div>
</div>
I think it should be what you're wanting:
<div data-role="page" id="index">
<div data-role="panel" id="mypanel">
Jump to index page
Jump to second page
Jump to third page
</div>
<div data-theme="a" data-role="header">
<h3 id="header-page">
First Page
</h3>
</div>
<div data-role="content" id="content-page">
<a data-role="button" href="#mypanel">Open Pannel</a>
</div>
<div data-theme="a" data-role="footer" data-position="fixed" id="footer-page">
.
</div>
</div>
<div class="soHide" id="index">
<div data-theme="a" data-role="header">
<h3 id="header-index">
First Page
</h3>
</div>
<div data-role="content" id="content-index">
<a data-role="button" href="#mypanel">Open Pannel</a>
</div>
<div data-theme="a" data-role="footer" data-position="fixed" id="footer-index">
.
</div>
</div>
<div class="soHide" id="second">
<div data-theme="a" data-role="header">
<h3 id="header-second">
Second Page
</h3>
</div>
<div data-role="content" id="content-second">
<p>this is a second page</p>
<a data-role="button" href="#mypanel">Open Pannel again</a>
</div>
<div data-theme="a" data-role="footer" data-position="fixed" id="footer-second">
footer second page
</div>
</div>
<div class="soHide" id="third">
<div data-theme="a" data-role="header">
<h3 id="header-third">Third Page</h3>
</div>
<div data-role="content" id="content-third">
<a data-role="button" id="open-panel">Open Pannel one more time</a>
<p>it's third!</p>
</div>
<div data-theme="a" data-role="footer" data-position="fixed" id="footer-third">
it's some third footer page
</div>
</div>
and this javascript:
$(document).on('click', '.btnPages', function(){
var page = $(this).attr('data-idpage');
var header = $("#header-"+page).html();
var content = $("#content-"+page).html();
var footer = $("#footer-"+page).html();
// apply
$("#header-page").html(header).trigger('create');
$("#content-page").html(content).trigger('create');
$("#footer-page").html(footer).trigger('create');
});
and this css:
.ui-panel-animate {
transition: transform 1350ms ease 0s !important;
}
.soHide { display: none; }
and this functional example http://jsfiddle.net/wgbn/Hxy37/

jQuery Mobile: data-rel="back" + data-transition does not work?

I created a jsfiddle that enables tabs using the navbar without changing the url hash: http://jsfiddle.net/ryanhaney/eLENj/
1) If I click on the "page 1" link from the home page, followed by clicking the "back" button, I get the reverse slide animation as expected.
2) If I click on the "page 1" link from the home page, then click on "page 2" or "page 3" (in the footer navbar), then click on the "back" button....there is no transition.
If I follow scenario #2 after changing the "$.mobile.changePage" call in the jsfiddle javascript to use a transition other than "none", the back button uses that same transition.
How can I enforce the transition for elements with data-rel="back"?
NOTE: In the jsfiddle example, it is desired behavior to keep tab selections out of the navigation history. The back button should go back home regardless of which tab you are on. There should be no transition between tabs. The jsfiddle example already provides this behavior.
I think I got it:
http://jsfiddle.net/E86M9/3/
Had to reset the changePage default transition value
$("a[data-role=tab]").each(function () {
var anchor = $(this);
anchor.bind("click", function () {
$.mobile.changePage(anchor.attr("href"), {
transition: "none",
changeHash: false
});
return false;
});
});
$("div[data-role=page]").bind("pagebeforeshow", function (e, data) {
$.mobile.silentScroll(0);
$.mobile.changePage.defaults.transition = 'slide'; // reset default here
});​
HTML
<div id="home" data-role="page">
<div data-role="header">
<h1>Home</h1>
</div>
<div data-role="content">
<p>
Page 1
</p>
</div>
</div>
<div id="page-1" data-role="page">
<div data-role="header">
Back
<h1>Page 1</h1>
</div>
<div data-role="content">
<p>Page 1 content</p>
</div>
<div data-role="footer" data-position="fixed">
<div data-role="navbar">
<ul>
<li>Page 1</li>
<li>Page 2</li>
<li>Page 3</li>
</ul>
</div>
</div>
</div>
<div id="page-2" data-role="page">
<div data-role="header">
Back
<h1>Page 2</h1>
</div>
<div data-role="content">
<p>Page 2 content</p>
</div>
<div data-role="footer" data-position="fixed">
<div data-role="navbar">
<ul>
<li>Page 1</li>
<li>Page 2</li>
<li>Page 3</li>
</ul>
</div>
</div>
</div>
<div id="page-3" data-role="page">
<div data-role="header">
Back
<h1>Page 3</h1>
</div>
<div data-role="content">
<p>Page 3 content</p>
</div>
<div data-role="footer" data-position="fixed">
<div data-role="navbar">
<ul>
<li>Page 1</li>
<li>Page 2</li>
<li>Page 3</li>
</ul>
</div>
</div>
</div>​
anchor.bind("click", function () {
$.mobile.changePage(anchor.attr("href"), {
transition: "none",
changeHash: false
});
return false;
Seems to be the issue with "transition: "none",". When I remove it or change it to anything, it works as you expect it: http://jsfiddle.net/PQsyP/

Resources