Issue with JQuery Datepicker theme not rendering properly

I have integrated the jQuery UI 1.11.4 with a customized Sunny theme. Take a look at how the date picker should appear below:

https://i.sstatic.net/1eEMU.png

To keep the current website style intact, I am using CSS Scope while applying the downloaded theme. Below is the code snippet within my page:

<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="/scripts/custom/jquery-ui.min.js"></script>

<link rel="stylesheet" href="/scripts/custom/jquery-ui.css" type="text/css" />
<link rel="stylesheet" href="/scripts/custom/jquery-ui.theme.css" />

<script type="text/javascript">
    $(document).ready(function () {
        $("#<%= txtSepDate.ClientID %>").datepicker({
            showOtherMonths: true,
            selectOtherMonths: true,
            changeMonth: true,
            changeYear: true,
            maxDate: "+0D",
            showOn: "button",
            buttonImage: "/images/calendar.jpg",
            buttonImageOnly: true,
            buttonText: "Select date",
            beforeShow: function () {
                $(this).datepicker("widget").addClass("grace");
            },
            onClose: function () {
                $(this).datepicker("widget").removeClass("grace");
            }

        });
    });
</script>

Upon accessing the page, this is the outcome I see:

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

Notably, my output lacks a few UI elements compared to the example:

  • The weekdays text
  • The calendar border
  • The calendar background

What might be the cause of these discrepancies?

Answer №1

Here is a demonstration of the datepicker calendar

<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></script>

<link rel="stylesheet" href="http://jqueryui.com/resources/themeroller.css"/>
<link href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" rel="stylesheet"/>
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css">
  <script>
  $(function() {
    $( "#datepicker" ).datepicker();
  });
  </script>
<style>
   
.ui-widget {
    font-family: Segoe UI,Arial,sans-serif;
    font-size: 1.1em;
}
.ui-widget .ui-widget {
    font-size: 1em;
}
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button {
    font-family: Segoe UI,Arial,sans-serif;
    font-size: 1em;
}
.ui-widget-content {
    background: #feeebd url("/themeroller/images/ui-bg_highlight-soft_100_feeebd_1x100.png") repeat-x scroll 50% top;
    border: 1px solid #8e846b;
    color: #383838;
}
...
... (Truncated for brevity)
...
.ui-icon-refresh {
    background-position: -64px -80px;
}
.ui-icon-shuffle {
    background-position: -80px -80px;
}

<!-- Additional CSS and HTML for the Datepicker -->
</style>

<!-- Datepicker -->
<div class="demo"><p>Date: <input type="text" id="datepicker"></p></div>

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

modifying output of data when onchange event is triggered

I am struggling with creating an onchange event for my option box in which the users of a site are listed. I have two input boxes designated for wins and losses, but the output is not changing when I select a user from the list. What could be wrong with my ...

Attempting to contain the dimensions of the image within the confines of the card results in failure

Currently, I am designing custom cards featuring an image in the form of a water droplet... However, I am encountering difficulties in maintaining the proper drop shape across varying screen resolutions. Any guidance on this issue would be greatly valued. ...

personalized XMLHttpRequest method open

var open = XMLHttpRequest.prototype.open; XMLHttpRequest.prototype.open = function(method, uri, async, user, pass) { this.addEventListener("readystatechange", function(event) { if(this.readyState == 4){ var self = this; var respons ...

Customize Bootstrap 4 scrollbar overflow with a sticky-top feature

Currently, I have a layout consisting of two rows: the first row is fixed to the top of the screen using sticky-top, and the second row fills the remaining height on the screen with min-vh-100. New content will be added dynamically to the second row's ...

Issues with Cordova and JQuery ajax functionality not operating as expected

I am facing an issue with implementing AJAX functionality in my Cordova app (CLI 6.3.1) on Visual Studio 2017. It works fine on the emulator, but I encounter a connection error when installing it on a mobile phone. I have already included CSP as shown bel ...

use jquery to select option by its value

I am faced with a choice of 4 options: <input type="radio" name="tag" value="1"/> <input type="radio" name="tag" value="2"/> <input type="radio" name="tag" value="3"/> <input type="radio" name="tag" value="4"/> On my previous page ...

What is the best way to resize a background image to perfectly fit the visible screen on a mobile device?

When accessing the website on a mobile device, the background image adjusts based on the amount of content on the page. It expands when there is more content and shrinks when there is less. For instance, opening the navigation panel on a mobile device caus ...

Rails implementation of autocomplete feature using sleek and seamless jquery integration

I've created a unique JavaScript code for a dropdown combo box feature that functions similarly to an autocomplete. I have added a button to the dropdown combo box, but I am struggling with figuring out the click event handler. The button should displ ...

continuously repeating css text animation

How do I create an animation loop that slides infinitely, repeating non-stop in full screen without breaking at 'hello5'? I want to display 3 rows of the same item from my items array. Not sure which CSS is causing the issue. The result I am loo ...

Invoking a JavaScript function within a different JavaScript function

Is there a way to ensure that the JavaScript function works properly even when using a text editor? var editor = $('#CKEditor1').ckeditorGet(); editor.on("instanceReady", function () { this.document.on("keydown", function (event) { ...

Changing Image Size in Real Time

Trying to figure out the best way to handle this situation - I need to call a static image from an API server that requires height and width parameters for generating the image size. My website is CSS dynamic, adapting to different screen sizes including ...

Tips for Deselecting a Table Cell in React

I've been working on a table in React and I'm trying to implement a feature where clicking on a cell colors it, and clicking on another cell uncolors the previous one. So far, I've managed to color cells upon clicking but I'm stuck on h ...

What is preventing me from being able to reposition certain tables on my site?

I have successfully implemented certain aspects of my responsive website, but I am encountering some difficulties in moving specific tables. I can adjust the table in various directions, except for moving it downwards. Even when adding the word !important ...

Refresh text displayed on a button with the help of setInterval

I need help updating the text on a button with the id fixed-button at regular intervals. Here is the code I am currently using: <script type="text/javascript"> $(function() { $('#fixed-button').setInterval(function() { ...

Is there a way for me to view the content through a link?

Is it possible to retrieve the link content using JavaScript and jQuery? <a href='http://example.com' id='my id'>content</a> ...

Refresh the datatable automatically when a field is updated without the need for AJAX requests

I need assistance with sorting a datatable column that contains checkboxes. The issue I'm facing is that the sorting is not working due to me changing the value of the column. Since it's not generated via ajax and I can't use the reload() me ...

What steps do I need to follow to create an aspx web page for receiving data from an outsourcer?

Looking to establish a URL for transmitting data, which can be found below. $batchid&mobile=$mobile&status=$status Hey there, I did some searching online but most of the information was about retrieving data rather than configuring a webpage and ...

Having trouble retrieving the appropriate selected item text from a dropdown list that is populated by a data table

I've been struggling for two days to figure out the source of this persistent error, but nothing I try seems to provide a solution. It appears that within a form, there are two dropdownlist controls, each populated by a method that connects to a data ...

The width of an iframe cannot exceed the width of its jQuery dialog box container

Exploring a JavaScript issue: When I include an iframe in my dialog, the width of the iframe is only about half of the dialog's width. It appears that jQuery is overriding the width value I specify and setting it to 'auto' instead. <htm ...

Troubleshooting Problem with Django and Bootstrap Styling

Currently, I am following some introductory Django tutorials to create a basic polling website. I have managed to get everything functioning properly, but I am struggling with the formatting on the "results" page for the polls. Here is how the page appear ...