Check if user selected Time has expired
Hi, I want to check if date is today, then user should not be able to pick expired time. However, if the date selected is tomorrow, then any time can be selected. I am trying to do a check in jquery, but not sure how to check. The date is in the format of "MM/DD/YYYY", and the time is in format of "hh:mm a". Expired time of 5 minutes is allowed Below is the code which I have tried: var targetTime = new Date().setMinutes(-5).valueOf(); var today = new Date(); var dd = today.getDate(); var mm = today.getMonth()
Start a function delayed after in "ready(function.."
hello, I successfully made a slideout menu. working fine if somebody clicks on the menubutton. $(document).ready(function () { $('#displaymenu').click(function () { $('#showmenu').toggle('slow'); }); }); but now I want it to slide out automatically after 30 seconds IF the menubutton wasn't pressed before. I want to show that there is a menu for people who don't know where to click. This menu should then automatically close after 5 seconds. But I don't really know which function could
Uncaught ReferenceError: jquery is not defined at index:19
<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="description" content="Neon Admin Panel" /> <meta name="author" content="" /> <link rel="icon" href="<?php echo base_url();?>assets2/images/favicon.ico"> <title> ADMIN </title> <script type="text/javascript"> var $ = jquery.noConflict(); //line 19 $(document).ready(function() { $('.fancybox').fancybox();
MouseMove Drag con coordinate del livello e.pageX, e.pageY
Buongiorno Ho questo codice js, vorrei mostrare le coordinate X e Y considerando come 0,0 il livello div.contenitore-mappa anziché tutta la finestra. Come posso operare? Grazie $("div.contenitore-mappa").ready(function () { var $dragging = null; $("div.contenitore-mappa").on("mousemove", function (e) { if ($dragging) { $dragging.offset({ top: e.pageY, left: e.pageX
Where is .attr('style') documented?
I've run into a function that uses $(el).attr('style'), that seems to bring back all the styles for $(el): function findStyle(el, attr){ // attr = 'color' var styles, style, color; try { styles = $(el).attr('style'); if (typeof styles !== typeof undefined && styles !== false) { styles.split(";").forEach(function (e) { style = e.split(":"); if ($.trim(style[0]) === attr) { color = $(el).css(attr); } }); } } catch(err) {} return color; } Does anyone know where this is documented? Thanks.
(function($){...})(jQuery)
(function($){ ... })(jQuery) Can someone explain all these wrappers? Is that the same with $(function(){...}) ?
datePicker changeMonth and changeYear selectors need title text (Accessibility)
A compliance checking tool such as Wave http://wave.webaim.org/ reports an error on the month and year selectors, because they have neither label nor title text. The easiest solution would be to add title text, which should of course accommodate localization.
Updating title attribute of selectmenu does not work
Hi, Let's say I have some <select> element in html: <select name='selector' id='selector' title='Old title'> <option value='0'>Option 0</option> <option value='1'>Option 1</option> </select> and in the JavaScript code I have: $('#selector').selectmenu(); So far, it works fine, i.e. hovering the mouse over the selectmenu widget shows the text 'Old title'. Now, let's say I want to change the site's language and in this case I execute the code: $('#selector').prop('title','New title'); This executes
Autocomplete with json call, suggest doesn't work
Hi, I am using jquery ui autocomplete. When use this with a call to json, I can't get that suggest feature works properly. I attach a link with code http://codepen.io/anon/pen/oBMyrO Thanks in advance!
opened slide in panel
Hello guys ive downloaded this http://jquerymobile.com/ I am using this demo http://demos.jquerymobile.com/1.4.2/panel-fixed/ I would like to have the panel first opened and then if someone wants to close it. How can i achieve that? Thank you!
About google map and to show location in map based on latitude and longitude.
Hello Everyone I want to display one particular location in map based on longitude and latitude , And I want to show the direction arrows for the street in which it will automatically when users move here and there. please anyone can help me how to achieve this!!. Can We do it by using jquery? Thanks in advance
Variable Scope in document.ready() function
Dear Friends, I following codes where I have setup a global variable but its value is not getting updated within the flow. Code is below. Please guide me to find a solution: var flgBtnBold; $(document).ready(function() { flgBtnBold=0; $('#btnBold').click(function() { if(flgBtnBold==1) { alert('within if block when true'); $(this).css("color","#000"); flgBtnBold=0; alert(flgBtnBold); } else { alert('within if block when false'); $(this).css("color","#f00"); flgBtnBold=1; alert(flgBtnBold); // It is
How to assign values to dynamically generated hidden item
I have a modal dialog where table rows are generated dynamically on button click. First column is an autocomplete text box .when user select an item this value must be assigned to the hidden element. The problem is multiple row will have multiple columns. I dont know how to sync with each element which is created on every button click and assign the selected value to hidden item every time Following is the code of autocomplete box $('body').on('focus', "#dataTable #pname", function (e) {
Upgrading code from jQuery UI 1.7 to 1.8 failing
I have some old jquery (UI) code that I want to upgrade to todays standards. Since my code was written for jQuery UI 1.7.3 I've decided to upgrade the code release by release. A release list is found here: https://jqueryui.com/upgrade-guide/ So if I open 1.8 Upgrade Guide I can see what was changed. So far so good. As far as I can see, the following changes apply to my code: Renamed _init() to _create() Renamed _setData() to _setOption() Removed _getData() since it should never be overridden $.widget()
iterate focus with keyboard arrows on images in different div’s
hi all, i want to be able to move focus on images that has the same class, with the keyboard arrows (in a thumbnail scroller). this is what i have: html: <div class="swiper-wrapper" id="swiper-wrapper" > <div class="swiper-slide" tabindex="0"><img src="cards/jpeg1.jpg" alt="" class="thumb"></div> <div class="swiper-slide" tabindex="-1"><img src="cards/jpeg2.jpg" alt="" class="thumb"></div> </div> jquery: var parent = document.getElementById("swiper-wrapper"); var children = document.getElementById("swiper-wrapper").children;
Drop if content matches
Hey, i am currently working on a jquery math game project where some tasks are in div elements on the rights side and the results are in divs on the left side. The divs with the tasks also contain a hidden div wich contains the result of the task. The users have to drag the result divs on the task divs. My question now is How can i check if the content of the two divs match? I would appreciate any help
disabling controls ?
I have to make a presentation to a group of older folks, and will likely do it as a webpage: it will be displayed via a medium-size tv screen (Sony Bravia). Navigation down through the layers would be by strategically-placed transparent gifs, and colored markers like those on googlemaps. I have this idea that those who want to could bring their iPads, and follow along, if they're in the back row or nearsighted: but wouldn't want them to navigate for themselves. So...would there be a way to disable
Executing two functions in the correct sequence
Hello all, I am a jQuerie newbie. Have spent hours on the net and still unable to fix a problem and now totally confused. I have two jquery functions. Function one has to be executed before function two. When I run the script function two is always executed first. Hope someone is able to assist and wish to thank them in advance. <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script> $(document).ready(function(){
Jquery Nestable plugin error with php
Hey guys, I have a problem with Nestable plugin,The first thing I want to say,I know normal jquery sortable plugin but I don't understand Nestable. My Code is apperead in above images; * http://i.hizliresim.com/yNQ2o9.png * http://i.hizliresim.com/6rOYqE.png Now, I want to send output to ajax.php file via post method.How can do it ? What variables should I send ?
Help with saving a JQuery Sortable Grid to a cookie.
I am new to jQuery, and coding in general. I have made a sortable grid that contains images with links that can be rearranged by dragging/dropping them, but i want the user to be able to save the order they have chosen. After refreshing the page the order returns back to normal, so i was wondering how the order could be saved , and retrieved from a cookie. Here's my code so far: <!doctype html> <html lang="en"> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1">
Am I over complicating my form validation?
I am trying to make my booking form a little more user friendly... I have three sections... First is a first/last name, email and phone number. Second is a calendar to pick your date Finally there is a dropdown select that shows a list of different time slots that are available. It looks like this: I am using tzjs to get the users time zone, and I am using moment.js to compare dates and times. The reason this form is complex is because I am only showing dates and times that are one hour in the future
How to toggle button on click?
Hi everyone! The issue I face is that I have identical "button-checkboxes", but once of of them is clicked, I only want the closest private class to change. <span class="button-checkbox"> <button type="button" onclick="privateClick()" class="btn btn-sm btn-default"> <i class="fa fa-square-o private"></i> <button> <input name="private" type="checkbox" class="hidden" /> </span> <span class="button-checkbox"> <button type="button" onclick="privateClick()"
Add a new method to a jQuery UI widget
The technique described in the docs for extending UI widgets works for me when extending an existing method, but not when trying to add a new one. Rather than repeat the details here, here's my SO question in full: http://stackoverflow.com/questions/42024327/add-a-new-method-to-a-jquery-ui-widget Thanks in advance for any ideas.
Change the content of the scr attribute of the img tag from a variable retrieved from a local file by the jquery load command
Hello, I have a big worry for me but small for you: I want to change the content of the attribute src of the tag img by a variable filter by the command load of jquery. This variable must have the value "node.png" as shown in my work at the attached address: <Div id = "tutu"> </ div> gives me the screen in the div: node.png. It is this value that I want to put in the attribute src of the tag img. Address of my work: http://plnkr.co/edit/pKSd7srxCCYGSRZonlQf Can you help me? Thanks for your help,
CDN page
The copy button doesn't seem to be working in Chrome for the minified 2.2.4 jQuery. Also, PLEASE get rid of the diagonal stripes once copy has been clicked. They provide absolutely no value and are extremely annoying.
How to stop adding the same words, that <element> already has
Well, I start from gathering 7 values from 7 <tr>'s: name 1 name 2 name 3 name 4 name 4 name 5 name 6 var names = $("tbody tr").map(function(ind, obj){ return $(this).children().eq(3).text(); }); But I need to remove duplicates, such as name 4 How can I do that? This code doesn't work for preventing text duplicates: $("span#complex").text( $.map(names, function(obj, ind){ if( $("span#complex").is(":contains(names[ind])") ) return; else return names[ind];
screen.orientation not working
Hi, I am trying to use https://github.com/apache/cordova-plugin-screen-orientation in my app but it's not working and no error.. I tried: screen.orientation.unlock(); screen.orientation.lock('landscape'); but: alert("Orientation type is " + screen.orientation.type); is working and showing the orientation type so it's installed succesfully but then why it's not changing the orientation of the device? Thanks, Jassim
Re-positioning of dialog after resize event
Hi guys, would be nice if the dialog corrects its position after the browser window was resized. Perhaps you coud provide an option for that.
slicknav
Hi, i got slicknav for mobilenav working, but i try to configre that after i clicked onto a link the navigation remember the link a clicked. Does s.o. has an idea how to get it to work? actually i called slicknav like this:: <script> $('#menu').slicknav({ label: 'MENU', duration: 1000, easingOpen: "easeOutBounce", //available with jQuery UI prependTo: "body", allowParentLinks: false, nestedParentLinks: true, easingClose: 'swing', parentTag: 'a', }); </script> Thanks
Using magnific popup type ajax in form Submit
I have a question. I am not much aware of javascript. I want to open a new page (showresults.asp) with all form data transferred to, using magnifique popup Type Ajax. The new window should open on pressing the form Submit (Send) button. I saw the following code in another post, it needs some modification for the requirements mentioned above. The link to post page is: <html> <head> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script src="https://rawgit.com/dimsemenov/Magnific-Popup/master/dist/jquery.magnific-popup.js"></script>
Framework to handle specializations
I have an application where I want to cut down on the amount of separate versions of code for each customization. One client gets one version another does not need the customization so I want to find a framework or build one such that a pre processor gets called when an event occurs on the page due to a click and if there is function for the event registered, that functional specialization gets executed and then control returns to the outer function. We never change the outer function. It returns
jQuery and xml / html output
Hello Im new to javascripting / jquery but do have basic working knowledge of (html/perl/powershell/vb), so can grasp basic coding concepts. I am trying to parse an xml file and get some data to be displayed in the wbe page's table section. This all works from googling most of what I am trying to achive and it works : -) , but I would like the data it collects to be displayed into different lines in the html table, and this is where my lack of know-how is stopping me in my tracks. The data, which
draggable helper : what is it ?
Hi. I'm experimenting with draggable/droppable. From the documentation it's not perfectly clear to me what the helper is and what is the difference between ui.draggable and ui.helper objects and by consequence what the clone option is for. ui.helper - the jQuery object representing the helper that's being dragged May anyone help me understand this? Thank you in advance.
selector question
Hello, There are multiple forms with each a submit button on the page. I want a selector for this: All submit buttons EXCEPT the one with class "thisclass" [type=submit].except(.thisclass) is a selector like this possible? Thanx!
Not able to retrieve value from textarea
I'm setting value in textarea using jQuery val(). later I need to retrieve value from the same text area, but it's empty <textarea class="smalltextarea" ></textarea> <input type="submit" name="btnSubmit" value="Submit" id="btnSubmit"> $(document).ready(function () { $("#btnSubmit").click(function(){ jQuery("textarea.smalltextarea").val("Test"); var getText = $("textarea.smalltextarea").val(); alert(getText); }); }); https://jsfiddle.net/d9Ljuo2v/4/`
Video removal from web page does not work
At first a sample source code as snapshot: https://abload.de/img/embeddedvideoddohu.png As you can see there is an embedded video just below the top photo. How can I hide/remove this video? I tried so far: $("#player").closest("p").remove(); or $('iframe[src="https://www.youtube.com/embed/*"]').css("display", "none"); but none of them work. Why not? Peter
How to use the value of an array as value of an attribute?
Hello wizkids/ wizman of this forum, I was wondering if I could use the vallue of an array as value for an attribute. var docus = ["#docu1", "#docu2", "#docu3", "#docu4", "#docu5", "#docu6", "#docu7", "#docu8"]; var spots = ["100%", "300%", "600%", "600%", "600%", "700%", "800%", "900%"]; for (var i = 0; i < docus.length; i++){ docus[i].css({ left: spots[i] }); } I have multiple pages and although I innitially wanted to make a function to add or subtract 100% of the left values. People on this website
jquery dialog window issue
Hello, I am upgrading to jquery2.2.3 and jquery-ui-1.12.1. Eventually I will go with jquery 3.0. For now I am following migration guidelines. 1. I am having a issue where text 'close' is coming behind 'X' image. - quickview.png is attached 2. In one of the title-bar, I am actually getting an entire text of the element that puts the title instead of the text itself. - storelocator is attached I have tried different things but I am new to jquery and I am not sure how to get this working. How
Multiple pictures upload jquery.
Hey All, I have working code for uploading a single picture, i want to change this to multiple pictures. I am having some trouble adjusting my code to get the information from all the files. How can i achieve this. I have this code. <input id=\"file-input\" type=\"file\" multiple> <div id=\"preview\"></div> <div> <button class='toevoegen' onclick='uploadpic();'> toevoegen </button> <button > Annuleren </button></div> function uploadpic(){ var data = [] var data = new FormData();
How to update page using jquery, if form action is successful?
I have a question about how to use jquery to update a page, if a form action is successful. Essentially, I am making a new page with a really simple form (name, email address, and comments boxes). I have made a real basic PHP file to call with the 'action=' attribute on the form. The php file does the job and sends me an email (if everything passed to it checks out). Here is where things get... interesting. I want to have it: 1. Not reload the page when the form is submitted. Instead, just update
Next Page