Swipe Gesture not working in Bootstrap 4 carousel - mobile

I recently build a Bootstrap 4.0 web site, using Dreamweaver, which contains several carousels. I’ve added the data-touch=”true” attribute to the code, however the swipe gesture does not work on mobile devices, and I can’t figure out why – I’m thinking either something in the code is preventing the mobile gesture from working, or there’s something missing that I need to add somewhere.
My understanding is that one simply needs to add the data-touch attribute to the code for this to work; no additional javascript is required -- at least, that's what the tutorials I've watched tell me. But, it seems I'm wrong about that.
Here’s one of my pages with a carousel:
https://neilgunner.com/page_Campaigns_1.html
Can anyone suggest why the swipe gesture is not working, and recommend a fix?
Thanks!

I'm late to this discussion, so I post this in case someone else stumbles in here as I did.
I'm using Bootstrap 4.5.2 and solved this by using the following:
<div id="myCarousel" class="carousel slide" data-interval="5000" data-touch="true" data-ride="carousel">
It didn't work for me without all three of the above data attributes set.

You can manually create the carousel-object after the DOM is loaded and the touchEvents will work. But you have to set the data-attribute for touch to true:
For Bootstrap 4.x:
HTML:
<div id="myCarousel" class="carousel slide" data-interval="false" data-touch="true" data-ride="carousel">
...
</div>
Script:
$('#myCarousel').carousel();
For Bootstrap 5.x:
HTML:
<div id="myCarousel" class="carousel slide" data-bs-interval="false" data-bs-touch="true" data-bs-ride="carousel">
...
</div>
Script:
var myCarousel = document.querySelector('#myCarousel')
var carousel = new bootstrap.Carousel(myCarousel)

Related

Issue selecting CSS Selector for Google Tag Manager

I am new to GTM and am creating a trigger on a site for my company. I have tried all the ways I know how and looked at Simo Ahava's blog and cannot get my trigger to fire. I am making a trigger that fires on element click and wants to have the Click Element match the CSS selector but cannot get it to work properly.
This is what I see when I inspect the component on the page:
<div _ngcontent-my-app-c1="" class="page-complementary jss-page-complementary" id="jss-page-complementary" name="jss-page-complementary" sc-placeholder="">
<!---->
<!---->
<app-tab-stories _nghost-my-app-c26="" _ngcontent-my-app-c1="" class="ng-star-inserted">
<!---->
<div _ngcontent-my-app-c26="" id="our-stories" class="tab-stories tab-stories--option-three">
<div _ngcontent-my-app-c26="" class="tab-stories__inner">
<div _ngcontent-my-app-c26="" class="tab-stories__header">
<h2 _ngcontent-my-app-c26="" class="tab-stories__heading">Our Stories</h2></div><div _ngcontent-my-app-c26="" class="tab-stories__wrapper">
<mat-tab-group _ngcontent-my-app-c26="" class="tab-stories__tabs mat-tab-group mat-primary ng-animate-disabled mat-tab-group-dynamic-height" disableripple="" dynamicheight="">
<img _ngcontent-my-app-c9="" class="ng-tns-c9-25 tab-stories__image ng-trigger ng-trigger-fadeIn ng-star-inserted" id="app-deferred-image_id_d1e0186a-6714-c0b4-649e-b9234689c136" alt="null" src="/-/media/images/images-sc9/locations/pch/general-pch/patient-stories/lexie-gardiner-square.ashx?&mw=400" style="">
I have tried the following CSS Selectors with no success, any help would be appreciated. The goal is to track that whenever anyone clicks on one of the stories under "Our Stories" they do not link off to anywhere just hidden content.
.tab-stories
.tab-stories__wraper
.tab-stories__image
div#our-stories
.tab-stories*
div#tab-stories*
div#tab-stories
Try .tab-stories__tabs
If it doesn't work, edit your question and add a complete set of html with closing tags so that we could actually inject it into a page and see how it looks.
You don't need to try your selectors in GTM every time. That takes too long.
Just do the following:
Inspect your element to open the Elements tab in the Chrome Debugger.
press ctrl+f while the Elements tab is being focused and start typing your CSS selectors.
The search in the Elements tab is smart enough to not only match literal matches, but CSS selectors matches too.
Debugging your selectors through the Elements tab is the best way to make sure nothing else would trigger your rule on this page and to see what exactly will trigger it.

ng-include doesn't do anything

I'm trying to include some HTML on my software's webpage using ng-include, and I can't seem to get it to work. For now, I am using simplified versions of my end goals for testing purposes.
Relevant snippet of my project tree:
-web
--dragonweb
---src
----app
-----dragon
-------dragon.css
-------dragon.html
-------dragon.spec.ts
-------dragon.ts
-------test.html
dragon.html
<div ng-app = "" ng-controller="test">
testing
<div ng-include="" src="'app/src/dragon/test.html'"></div>
</div>
test.html
<div>
This is an included file
</div>
Expected output on the web page:
testing
This is an included file.
Actual output on the web page:
testing
I've tried using different lengths of the path to test.html, with no luck. I've also been playing around with the use of the ng-controller tag, and syntax for the ng-include tag, with no luck. There are no console errors in the web page. Any idea why it doesn't seem to be working?
Backstory/disclaimer: I was the intern on this project before inheriting it after the lead dev suddenly left, this is my first time doing any sort of web development, and I'm just learning on the job from trial and error. So if I'm doing things wildly incorrect, I am absolutely all ears for how I can improve this process! I chose to try to use ng-include because we already have Angular implemented, and based on my research this seemed like the theoretically easiest way to accomplish what I wanted.
You need to pass the src to ng-include directive not the src attribute:
Ex:
<div ng-include="'app/src/dragon/test.html'"></div>
or use relative path:
<div ng-include="'./test.html'"></div>
Please check out the official documentation for details
Usage:
as element:
<ng-include
src="'string_url'">
...
</ng-include>
as attribute:
<ANY_ELEMENT_TAG
ng-include="'string_url'">
...
</ANY_ELEMENT_TAG>
as CSS class:
<ANY class="ng-include: string; [onload: string;] [autoscroll: string;]"> ... </ANY>

GTM trigger on image showing

Struggling with the DOM visible/element variables. Below is the code on page:
Below is the code, if either that image shows (failed.png) or the text says "Sorry! Something isn't quite right." I want to fire a trigger. How would I go about this? I'll also have a different trigger if it's successful, which would be a different image.
<div class="page page--result result center">
<img src="/images/fb/failed.png" class="result__img result__img--success"/>
<p>Sorry! Something isn't quite right.</p>
<br/>
Thanks
david

Angular UI Bootstrap 2.3 Modal is not rendering sightly parameters

I am having a compatibility issue with Angular UI Bootstrap Modal and sightly Parameters. When I try to render the sightly parameters inside the Modal the modal does not render the value in the sightly parameters as:
<script type="text/ng-template" id="stackedModal.html">
<div class="modal-header">
<h3 class="modal-title" id="modal-title-{{name}}">${properties.something} </h3>
</div>
<div class="modal-body" id="modal-body-{{name}}">
${properties.something}
</div>
</script>
As far as I have observed, there is an issue with printing inside the script tag.
Can someone help me if they have got the same issue?
Modal that I am using is Angular UI Bootstrap verion : 2.3 : http://angular-ui.github.io/bootstrap/
First, you need to provide more context, where your HTML is located? your folder structure and what you are trying to achieve.
Second, Sightly happens on the back-end and Angular in the browser so you should not have incompatibility there, I think your problem is somewhere else.
By default, HTL/Sightly includes XSS protection. In this case, for ${properties.something} the implicit scriptToken context is used (https://github.com/Adobe-Marketing-Cloud/htl-spec/blob/master/SPECIFICATION.md#121-display-context) and probably cuts off the content (in case it has characters that are not allowed in that context).
You can probably set a more relaxed context: ${properties.something # context='html'}

ng-include Stopped working after update to 1.2.0rc1

Yesterday when I was using older version, everything worked fine. My code looked like this:
<div ng-repeat="widget in widgets" class="box" ng-include="widget.view"></div>
Today I updated to newer version and it seems that it doesn't work anymore. I tried different versions of how to use ng-include and this one below renders a comment where the content should be:
Comment:
<!-- ngInclude: widget.view -->
Code:
<div ng-repeat="widget in widgets" class="box">
<ng-include src="widget.view"></ng-include>
</div>
I've also tried moving views out of partials into script tags but it doesn't help. Before I moved to script tag there was SUCCESSFUL xhr request to partial, but it just didn't render it.
What could be wrong?
Edit: if I change version back without any code modification, everything works again.
Possibly it's this issue https://github.com/angular/angular.js/issues/3627 foo bar foo bar

Resources