Sticky mobile UI elements in Kendo

I am currently using Kendo mobile UI in conjunction with jQuery to create a hybrid app.

In my app, I am working on a list of relations along with a searchbox placed at the top of the list. However, while scrolling through the list, the searchbox also scrolls down with the content, but I want it to remain fixed at the top.

Here's how my view is structured:

<div data-role="view" data-title="Relations" data-layout="main" data-model="app.relations" data-show="app.relations.onShow" data-after-show="app.relations.afterShow">

<div class="search-box">
    <input type="text" class="search-input" id="searchRelations" placeholder="Search...">
</div>

<ul id="relations" class="data-list"></ul>

This is the CSS used for styling:

.search-box {
 position: fixed;
 top: 0px;
}

Is there any solution or idea on how to resolve this issue?

Answer №1

Make sure to utilize the following code snippet:

.search-box {
 position: absolue;
 top: 0px;
}

This will ensure it functions as intended.

Keep in mind that using 'position: fixed' will keep the element fixed on the screen, regardless of scrolling. It will always remain in the same position.

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

Activate the horizontal scrollbar within each flex item when it is stretched beyond its original width

My goal is to have both the child-1 (blue) and child-2 (black) retain their original width when the sidebar appears by enabling horizontal scrolling upon clicking anywhere in the demo below. document.body.onclick = () => document.querySelector(&apos ...

Left align the CSS menu text next to the menu image

Currently, I have a basic CSS menu that includes background images aligned to the left. My goal is to have the text float to the left of each image as well. <div class='mmenu'><ul><li><a id="li6" class="menu-news" href= "vie ...

Gracefully Switching Between Various Functions

Suppose I have a collection of functions that perform various tasks: function doSomething() { console.log('doing something'); } function accomplishTasks() { console.log('accomplishing tasks'); } function executeAction() { console. ...

Guide to activating the 'Next' button on WP Forms using JavaScript code when certain conditions are fulfilled

Is there a way to adjust the JavaScript code provided so that the visibility of the "Next" button is dependent on whether at least one item in the 'wpforms-icon-choices-item' class has the '.wpform-selected' class on the current page or ...

Sending PHP data to an email composed in HTML

When sending an HTML email to my users using inlined CSS mixed with the HTML, I encounter a problem. How can I pass my variables from PHP to the HTML and use them accordingly when sending the email? For example, the email is supposed to contain the user&ap ...

Populate Jquery datatables programmatically

After implementing the Jquery Datatables plugin, I initially had hardcoded content in the table. However, I made some modifications to dynamically populate the table with fetched data. While this change worked fine, I encountered issues with the search f ...

Utilizing JQuery's ajax function to interact with a POST webservice

After successfully creating a Jersey web service, I attempted to access it using JQuery. It seems like the ajax() method would be the best approach. I followed some advice from here, but encountered an error displaying as [object Object] in the alert mess ...

Loading HTMLs with AngularJS and jQuery

Currently, my application is built using C# MVC5 and jQuery. I am interested in gradually transitioning certain parts of it to utilize AngularJs. One specific issue I am facing involves loading an HTML element with jQuery using the .load method. My goal i ...

Retrieving the value of an inputtext component in PrimeFaces using jQuery

I have the following code snippet: <h:form id="calcForm"> <h:panelGrid columns="3" styleClass="panelGridNoBorder"> <p:inputText id="value" /> <p:commandButton value="calculate " onclick="calc()" /> </h:panelGrid> ...

What is the best way to create a circular upload button design on a website using either bootstrap, React, or materialUI?

Here is the desired appearance: Click here for the image, with a circle indicating where the photo should be uploaded <div class="container "> <div class="row mx-auto"> <div class="col "> ...

Clipped Words & Silhouettes

I'm having trouble ensuring the text in this particular example displays correctly. I am experiencing challenges with the clipping of text and shadows on certain letters, and I'm struggling to identify the root cause as well as the solution. In ...

The CSS within a Vue Single File Component can sometimes take precedence over certain styles from buefy/bulma, while other styles may

Seeking assistance on how to troubleshoot this issue. In a Vue project, buefy is imported from main.js as follows: import Vue from 'vue' import Buefy from 'buefy' import './style.scss' Vue.use(Buefy) import Client from &apo ...

Select2 Bootstrap - Preselecting Options

I am currently utilizing Bootstrap Multiselect but I am encountering some difficulties setting the default value for the multiselect as per the documentation provided. Inside a function, I have tried the following: $("#selector").multiselect("select", ["V ...

Vue component lacking Scss styling

One of the components in my project is an Img component, which includes a figure with a nested image element: <figure> <img @dragstart="stopDrag" :src="src" /> </figure> When using this component within another comp ...

Can anyone explain to me how to utilize jquery ajaxstart and ajaxstop in conjunction with $.post()?

I am looking to display a loading gif on my website. Here is the current code I have implemented: $("#mail-change input[type=submit]").click(function(event){ $.post('user_settings.php', $("#mail-change").serialize(), function(res) { $(res).in ...

The total height of an HTML element, which takes into account the margin of the element itself

Is there a way to accurately calculate the height of an element including margins, even when dealing with child elements that have larger margins than their parents? HTMLElement.offsetHeight provides the height excluding margin, while this function from ...

I am encountering issues with setting a background image in Bootstrap 3.1.1 while trying to achieve a par

I'm struggling to add a background image to my bootstrap site. I'm attempting to create a parallax site using stellar.js, and while the site is functional with text on each slide and correct scrolling links, the images just won't load. Despi ...

Stopping the Bootstrap carousel when an input is focused

I have a Bootstrap carousel with a form inside. The carousel is set to pause when hovered over, but I noticed that if the cursor leaves the carousel while typing in the inputs, it goes back to its default cycle of 5000ms. I want the carousel to remain pau ...

Triggering an id import via ajax when changes occur

I've come across a small script that I didn't create myself, and I want to make some modifications to it, but I've hit a roadblock. The script features two select options: one for selecting a state and the other for selecting a city. When a ...

Storing user's input data from a multi-step form into a cookie with the help of ajax

Is there a way to create a multipage form that saves data into a database, allows users to close their browser before completing it, and repopulates with previous session values when they return? I understand that using a cookie is necessary for this tas ...