Tips for Properly Positioning Floating Pop-Up Messages Using CSS and jQuery

I was experimenting with adding a button that triggers a popup message to my website. I followed a coding tutorial using jQuery and CSS, which looks like this:

Javascript :

!function (v) { v.fn.floatingWhatsApp = function (e) {...} }(jQuery);

CSS :

.floating-wpp{position:fixed;bottom:15px;left:15px;font-size:14px;transition:bottom .2s}...

HTML : including scripts and body placement

<script type="text/javascript" src="catalog/view/javascript/jquery/whatsapp/floating-wpp.min.js"></script>
<link rel="stylesheet" href="catalog/view/javascript/jquery/whatsapp/floating-wpp.min.css">

<body>
  <div id="myDiv"></div>
</body>

<script type="text/javascript">
$(function () {
  $('#myDiv').floatingWhatsApp({
  phone: '12345678910',
  popupMessage: 'Helo, how can we help you?',
  message: "",
  showPopup: true,
  showOnIE: false,
  headerTitle: 'Whatsapp Chat',
  headerColor: '#128C7E',
  backgroundColor: '#25D366',
  buttonImage: '<img src="catalog/view/javascript/jquery/whatsapp/whatsapp.svg" />'
  });
});
</script>

Despite following the tutorial correctly, I encountered an issue with positioning the button and popup message on the bottom right of my website. Additionally, I struggled with making sure the elements appear above other content on the webpage.

The difficulties I faced include typing in the chat window and closing the popup:

https://i.sstatic.net/GRmq6.png

If anyone has expertise in CSS and jQuery, your assistance would be greatly appreciated. Thank you for your support!

Answer №1

Seeking assistance for this issue was quite challenging, as even large forums like stackoverflow were unable to provide a solution.

After dedicating some time and effort, I managed to resolve the problem on my own in just a few hours.

I appreciate the lack of response from stackoverflow, as it motivated me to find the solution independently.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Exploring the scope of event listeners in jQuery's TimeCircles

Currently experimenting with the jquery timer known as "TimeCircles", which can be found here. I have successfully set up a minute / second timer for 30 minutes with an alert that triggers at 25 minutes. My goal is to implement an event when the timer hits ...

Surprising margin discrepancy of 10px found while utilizing float property in CSS

Encountered an issue with the CSS property "float". There is a 10px margin at the top of the page. How can this be fixed? I tried adding an empty div to the parent div with id="background1", but it did not work. I also found this article https://css-trick ...

The process of parsing HashMap failed due to an unexpected encounter with an Array, when an Object

Currently, I am in the experimental phase of creating an action at Hasura using a Node.js code snippet hosted on glitch.com. The code snippet is as follows: const execute = async (gql_query, variables) => { const fetchResponse = await fetch( "http ...

Experiencing an "isTrusted" error while working with the GLTFLoader

QUERY: All was running smoothly: I successfully transformed my FBX files to GLTF in the /GLTF/ directory. Unfortunately, after noticing missing geometry in some converted files, I attempted another conversion of the FBX files, this time to /TEST/. Unexp ...

Executing a JQuery click event without triggering a page refresh

I'm dealing with a basic form on a webpage <div class="data-form"> <p>Are you hungry?</p> <form> <label class="radio-inline"><input type="radio" name="optradio" value="yes">Yes</label> ...

AngularJS fails to fetch data from API queries

Currently facing a challenge with retrieving API data in my AngularJS project. The code below successfully fetches the data and logs it on the console as an array, but I am unable to access and utilize it in the front-end. Please note that the placeholder ...

Ways to eliminate the up and down arrow in the MUI number field

How can I remove the up and down arrow from the MUI number field? My current version is 5.3.0. Is it possible to achieve this using the sx prop? Learn more about the sx prop here <TextField sx={{...}} id="outlined-number" label="Nu ...

Finding a specific child element using WebDriver

After encountering a particular issue with my HTML code structure, I found myself in a bit of a conundrum. The HTML consists of multiple divs, each containing the same set of tags but with different text within the h3 tag. My goal was to locate and interac ...

What is the functionality of this JavaScript code after the "if" statement?

I am having trouble understanding how this code works, especially after the if(y in hash) statement. I don't see any values being pushed into hash initially. Can someone explain what happens behind the scenes and the significance of y in hash? var ...

Ways to call a DIV element in a PHP file from a different PHP file

I am facing an issue with referring to a specific <div> element from one .php page to another. The current code is redirecting me to the home page of the first page, instead of displaying the desired content. Can anyone provide guidance on how to ach ...

Implementing Button Activation and Deactivation Upon Checkbox Selection in JQuery

When a single checkbox is selected, the Edit and Delete buttons are enabled while the Add button is disabled. If two or more checkboxes are selected, the Delete button is enabled while the Add and Edit buttons are disabled. This is my HTML code: < ...

Struggling to make align-content function properly in a CSS flexbox layout grid

Utilizing CSS flexbox for designing a grid of items that wrap on resizing the page. Wanting to achieve a horizontally centered grid, successfully done with justify-content: center;. However, facing an issue where the last box in some cases is centered inst ...

Is there a way to launch a browser in full screen mode using a command line interface?

Is there a clever way to launch a web browser in full screen mode from the command line? The browser's full screen API only activates in response to user interaction. I simply want to show data on a large monitor without any unnecessary elements lik ...

Exploring the Prototype-based programming concept in JavaScript

I am determined to deepen my understanding of JavaScript and explore what lies beneath its surface. While I have delved into various guides on the Object-Oriented Paradigm with Prototypes in JavaScript, I am struggling to comprehend how this paradigm diffe ...

Free up MySQL connections within a Promise.All implementation

At the moment, I am facing issues with releasing MySQL connections from a connection pool. Interestingly, when I release connections in a synchronous "for" loop, everything works fine. However, when I attempt to release them asynchronously using Promise.Al ...

What is the reason behind fixing an overflow issue simply by moving the mouse outside of a container in IE7 and HTML?

My webpage includes a series of questions, with each question being displayed or hidden based on the answer to the previous question. Occasionally, after toggling back and forth between questions, I notice that the final question appears below its designa ...

The variable for Google Maps has not been defined

I'm currently working on developing a map that will display multiple markers based on custom posts with metaboxes. The end goal is to have a map showing markers with the post title, some description, and a link to the post. Although I feel like I&apo ...

Unable to successfully perform DELETE or UPDATE operations with Axios MySQL, encountering errors

I am currently working on a project that involves using Axios with Node.Js to perform a delete request in a MySQL table. However, I seem to be encountering an issue as I am not receiving any errors in the console despite having an error catch console.log s ...

Sending data from a PHP function to an AJAX call in the form of an associative array using json_encode() does not

Greetings, this is my first post so please forgive me if I miss anything or fail to explain clearly. All the code below is within the same PHP file. Here is my AJAX call: $.ajax( { type: "POST", url: window.location.href, data: {func: 'g ...

Parsing JSON data in JavaScript

I am facing an issue with parsing JSON using JavaScript. After the completion of the loop, my variable 'text' is not getting the expected result. Can someone please explain how I can correctly parse this JSON? var xmlr = null; var text = '& ...