473,385 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

AngularJS Parent Getting Swipe with Child

I am using child div that is swipebale inside parent div which is using ng-carousel for swipe.
I am facing the problem that whenever i am trying to swipe child div ,parent div is also getting swiped.
I tried stopPropagation(), preventDefault() it is not working.

Please advice....Urgent help appreciated.
May 24 '15 #1
2 18797
Varsha1285
16 16bit
t sounds like you have a touch event propagation issue. stopPropagation() and preventDefault() are used to prevent the event from propagating to parent elements, but in your case, the event is still propagating to the parent div. Here are a few suggestions to try:

Use the touch-action CSS property to control the touch behavior of your child div. For example, you could set touch-action: pan-y on the child div to only allow vertical scrolling within that element. This should prevent the touch events from propagating to the parent div.

You can add an event listener to your child div that captures the touch events and prevents them from bubbling up to the parent div. For example:
Feb 24 '23 #2
Varsha1285
16 16bit
To enable swipe functionality in an AngularJS parent component with a child component, you can make use of a third-party library such as HammerJS or ngTouch.
Apr 18 '23 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Omar Llanos | last post by:
I have Form1 and Form2 (which is inherited from Form1), and I created a button in Form2 that will fill up a textbox in Form1. What code would do that? I tried the simplest way: //from child...
8
by: Waleed Seada | last post by:
Hi all What need to be done to get the MDI parent call his MDI children Events, methods Thanks in advance /WS
2
by: Raj | last post by:
Hi All, I have a problem with trying to refresh the parent window from child window in order to update data in the parent window. The sequence of events are 1) I click a button in the parent...
1
by: Michael | last post by:
Hi Everyone, I seem to be having a problem accessing a menuitem on the MDIParent from a child form. From a login (frmSecurity -child form) screen, I need to hide a menuitem based on the users...
2
by: VBLearner | last post by:
How to close the parent and all child forms together at once when click on parent window's close button X?
1
by: Eric | last post by:
I want to call a method on the MDI parent from the child. Basically the method will set some text (message) on a status strip and show the appropriate icon (for the type of message). I'd also...
1
by: bhargavi ramineni | last post by:
I have used the following javascript code to get a child window for parent window. childWin...
7
by: markrandolph | last post by:
I have parent.htm and child.htm ================================================================= In parent.htm we have: var parentarray = new Array(5) window.open("child.htm",.....) ...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.