Content selection custom attributes
I am trying to extract the value JHON DOE from this span tag and I am unable to figure out how to do this without a brute force of searching for each element and doing a manual string match. Any thoughts? Thanks Ivan <span data-bind='text: pname()'>JHON DOE</span>
Not Able yo Add Previous Function(Slide Back) to Simple jQuery Slider
Can you please take a look at this demo and let me know how I can enable previous button to slide to? as you can see the next button is working fine but I am not able to slide back $("#slideshow > div:gt(0)").hide(); $("#next").on("click", function(){ $('#slideshow > div:first') .fadeOut(1000) .next() .fadeIn(1000) .end() .appendTo('#slideshow'); }); $("#prev").on("click", function(){ $('#slideshow > div:prev') .fadeOut(1000) .next() .fadeIn(1000) .end() .appendTo('#slideshow'); }); <button id="next">
Sortable plugin is not working i don't know what mistake i have made can some one please help me?
<!DOCTYPE html> <html> <head> <link href="https://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel="stylesheet"> <script src="https://code.jquery.com/jquery-1.10.2.js"></script> <script src="https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script> <script type="text/javascript"> $(function() { $(".rightItems").sortable(); }); </script> <style type="text/css"> .leftItems{ text-align:center; border:1px solid red; background-color:red;
how to calculate a total based on type
Hi everyone I have a html table that the rows are added dynamically and there is a column Type where the user inputs the following values from a drop down combo box : Ncc Regular code what I would like to do get the sum for every type for ex. the sum of Regular the sum of Ncc I been on this for days and cannot figure out how to do this below is a picture of the table
Floating Labels for Select Dropdown
I am using this code which returns "undefined" for the label of Select Boxes. This is because presumably the placeholder attribute is not supported for select elements. (function($) { 'use strict'; $.fn.jvFloat = function () { return this.filter('input:not([type=submit]), textarea, select').each(function() { function getPlaceholderText($el) { var text = $el.attr('placeholder'); if (typeof text == 'undefined') { text = $el.attr('title'); }
Gaining the eq() inside a div.
Hi, I have included a fiddle but I want to know how I can return the eq() of a class in a particular div. For example when the user clicks on a team name it returns the eq() of the class (in this case club) from the parent <div> it is contained in.. So if the use clicks on Manchester City, it returns 1 as would Wolverhampton as both are are in different containers with a different id. Here is the fiddle: https://jsfiddle.net/a4poster/xpvt214o/932775/ Thanks in advance.
Browser autofill not working on dynamically appended DOM element
I am using jquery modal plugin to raise modal forms on a page. If I make the modal form visible on page load (as a test, and not yet raised by the plugin), the browser's autofill functionality works fine in the input fields. But, when I raise the modal form using jquerymodal (it detaches then appends the modal element to the body) the autofill no longer works. Any idea as to why? I thought it might have to do with the fact that the form code is inside <form> tags on the page, but when the jquery
setTimout and dialog.close with jquery after return message
I have an email submission modal and everything works fine. It grabs the data, PHP processes the data and sends an email and then gives the success message back to the script then the script display "thank you for submitting. blah blah blah." After that I'm trying to use setTimeout to close that final message but it isn't working. Here's the code that finishes the email submission: if (data.responseText !== ' ') { $(#emailModal).text(data.responseText); setTimeout(function(){ $('#emailModal').dialog('close')},
Count the number of elements within specfic div
Hi there, I have following code <div id="car_0> <div class="card"> <input id="Max.Index" value="0"> </div> <div class="card"> <input id="Max.Index" value="1"> </div> </div> <div id="car_1> <div class="card"> <input id="Max.Index" value="0"> </div> <div> How do I count the number of Max.Index inside each <div id="car_x>? Joe
Locating nearest section id if it exists
I need to pass the id of the nearest "section" if it exists. If a section doesn't exist, I need to pass the "formPlace" hidden field. If that doesn't exist, I need to pass the URL of the page. How can I do that with jQuery? <section id="contactForm"> <form... <input type="hidden" name="formPlace" id="formPlace" value="contact1234"> ... </form> </section>
Reveal dropdown happening twice only on ipad
I have a dropdown which is dynamic so the height should match the content and remain responsive. It works on everything except ipads (tested on ipad 2 and 3), chrome and safari exhibit same behaviour on it. I dont think its a double click issue. Heres the jfiddle to see the issue. Any help appreciated. Edit: Fix below using animate instead :) https://jsfiddle.net/Bassquake/q2zo6e7b/1/
PHP array to jquery
I have a PHP page that grabs images from a directory and puts the file names into an Array. I can display the images on the PHP page using a foreach loop so I know the PHP is grabbing the file names. I script src=getImages.php on my web page but cannot get the images in the array. After a lot of googling I think I need JSON or JSON_encode or JSON implode. But after many iterations of trial and error I'm here asking for help. I want the image names in the array from the getImages.php to be available
Randomize response message
Hi. I have AJAX form for WordPress that sends user email to my inbox. Here is js code for it https://pastebin.com/p9hhz4M7 I need to randomize displaying success (line 9-10-...) and error messages (line 25-26-....) regardless of the actual result. This form is just for testing purposes. How can I achieve this? Thanks for help.
help adding 3 text box values and show in a 4th
Good Afternoon every one I'm very new to jquery and javascript I have 3 text boxes that I need to add up there values and display the result in a 4th textbox I have a functiion that I got from a friend but it's not calculating the 2nd textbox value which is populated form a total of a table column I've tried every thing and cannot get this to work here is the code <script type="text/javascript"> $(function () { var textBox1 = $('input:text[id$=tij]').keyup(foo); var textBox2 = $('input:text[id$=ptotal]').keyup(foo);
Newbie needs help with jquery multiayer menu
Hello there, I am a beginner in java and have no idea about javascrip, but have tried my best with this,I need to create a dynamic dropdown menu from a predefined array. Here is the array I need in javascript var Alerts = new[] { new Alerts { Id = 1, Module = "Form I", Application = "Registration", Message ="1" }, new Alerts { Id = 2, Module = "Form I", Application = "Registration", Message ="1" }, new Alerts { Id = 3, Module = "Form I", Application = "Retire", Message ="1"
Property missing
{"10-29-2018":{"trip_date":"2018-10-29","dataset":{"09:30 AM":{"available_seats":"54","already_booked":0,"max_seat":"54","internal_only":{"07:00 PM":"0"},"stop_selling":{"07:00 PM":"0"}},"07:00 PM":{"available_seats":"54","already_booked":0,"max_seat":"54","internal_only":{"07:00 PM":"0"},"stop_selling":{"07:00 PM":"0"}}}},"10-30-2018":{"trip_date":"2018-10-30","dataset":{"09:30 AM":{"available_seats":"54","already_booked":0,"max_seat":"54","internal_only":{"07:00 PM":"0"},"stop_selling":{"07:00
expanding "r.fn.init" object in console
I used console.log on a $(e.target).parent() and I have something like this: r.fn.init [li, prevObject: r.fn.init(1)] However,when I expand this object, this is what I see: r.fn.init [li, prevObject: r.fn.init(1)] 0: li.active length: 1 prevObject: r.fn.init [a#link-LEVEL4-01] __proto__: Object(0) I don't understand why "li" is set on active inside. When I used the function addCLass() or removeClass(), it seems to affect only the "li" that I see beside r.fn.init, but not the "li" that I see inside.
Change class on Scroll - Vertical Dot
Hi there, Im trying to write the cleanest code to change a dot colour on a vertical dot navigation element. Basically, when the user scrolls to the next section, the class should be removed on the old circle, and added to the new one. This is what happens when the user clicks the button (the code is wrapped inside a click function). //Change dot class circle_curr = '#' + curr_pos.toLowerCase() + '_circle'; circle_target = target + '_circle'; $(circle_curr).removeClass("current"); $(circle_target).addClass("current");
a href to DIV causing img issues
I am trying to link an automatically created series of thumbnails so when someone clicks on one, it opens in a div that will display the full version of the photo. When I click the link, it opens in the DIV but instead of the picture I get a lot of: ���� JFIF ��C ��C �� X � " �� ��J ! 1A "Qa q2� #B���Rb���� $3�r�� 4C%� 5Sc����� ��7 !1 AQ " 2aq����#B��� 3R� b���
Synchronous loading causing warning
I am developing the jQuery plugin below, and this issue at GitHub was raised by a user . The plugin is responsible for "throwing" a warning in the console: Synchronous XMLHttpRequest on the main thread is deprecated because of
its detrimental effects to the end user's experience. I attempted to research the possible cause and have ruled out that it is due to a missing async: true in the central $.ajax() call. Next, I've ruled out, that it is due to attaching script tags, as described in here...
help with column total display
Hi every one, I have two html tables parts and items that the rows a added dynamically, with the same code the tables add and remove the rows but the the total for the item table displays in the total text box for the parts table, also can't get them to subtract the total when a row is deleted here is the full code <input type="checkbox" id="chkparts" /> <label>Parts </label> <div id="dvParts" style="display: none"> <form id="parts"> <table id="purchaseItems" name="purchaseItems" align="center">
If parent element contains certain child element
Hi. I'm trying to hide sertain elements <button class="sidebar__categories-toggle">></button> only in those divs that do not have child elements <ul class="sidebar__categories-list"> . So if category has subcategories then I need this sign <button class="sidebar__categories-toggle">></button>, but if not - then I need to hide it https://jsfiddle.net/advokatb/cxw7q1f8/11/ Tried (function(jQuery) { jQuery(document).ready(function() { if (jQuery('li.sidebar__categories-item').find('ul.sidebar__categories-list').length
jQuery alternative for slice call argument
Is there a cleaner way to do this using jQuery? I had a solution worked out to display the dynamic phone number, which is based on the URL string, using the id, but then realized the phone number could possibly appear in multiple places on the page. $(document).ready(function(){ var tfn = QueryString.tfn; if(tfn == '1111') phoneVar = '800.555.1111' else if(tfn == '2222') phoneVar = '800.555.2222' else if(tfn == '3333') phoneVar = '800.555.3333'
Return data after ajax call success
Hi everone how can I return data after ajax call success. I try to do it using async: false, but my browser is frozen. I wan to do something like this function ajaxtest() { var ActChatDepartmentArray = new Object(); $.ajax({ url: 'ajax/boldjsonfilewithoneparam/', type: 'POST', async: false, headers: { "X-CSRFToken": '{{csrf_token}}' }, data: { 'DepartmentID': DepartmentID, 'paramString': "DepartmentID",
Is there a better way to rewrite my ajax call please
Hello, I am using jquery with an API, I need to output different error messages based on the response. I would like to know if there is a way to rewrite my ajax call in a more efficient way please, why? 1)I would like to shrink my responses with only 4 possible outputs ": 200 401 500 and else(a global for all the other errors). <--- how to default any other errors to one single response? Also, I have noticed that when the API is down and the the ajax returns error 503, I am not able to catch this
Ajax connection time out on firefox & Edge
I am calling a method in server side using ajax. This server side method is a batch operation and it takes around 20 - 30 mins to complete. When I run the web site on Chrome everything works fine. Bur on Edge and Firefox the ajax error method is invoking after around 1 hour. When I enable the logs the server side method is completing without an issue. But the ajax success method is not calling. After the server side method complete, ajax call is still active and after some time ajax error method
How To Make An Element Move Diagonally (i.e. Hold "Up" and "Right" Arrow Keys) With Arrow Keys
I have everything setup so that whenever I hold one of the Arrow Keys, my DIV will move in the direction that I push. But when I hold one of the Arrow Keys, and then hold another one at the same time (i.e. Up and Right) the DIV only moves in the direction that was first pushed, instead of moving Diagonally.
How to integrate Jquery with html
Hi All, This is my first question on this forum. I am automating a process wherein I need to login to a website and navigate to specific tab and then download few CSV files from that website. I have written a Jquery code which works fine in chrome console but I want to integrate this code with html and I am not able to do that as I am not sure what should be called in body tag of html. Can somebody please help me ? <!DOCTYPE html> <html> <head> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
How to loop through form elements created with the append function
Hello, How to loop through form elements created with the append function ? var html = '<tr>' +'<td><input type="text" name="label[]" class="label width400" value="" required /></td>' +'<td class="formElem"></td>' +'<td><input type="text" name="name_column[]" class="name_column" value="" class="width400" required /></td>' +'<td><button type="button" class="removeColumn">-</button></td></tr>'; var numColumn = $('#numColumn').val(); for (i = 0; i < numColumn; i++) { console.log('i : ' + i); $('#table_create').append(html);
Zoom elements inside dialog window
When I want to zoom out elements on a web page I then Scroll the mouse wheel up or forward while holding down the "Ctrl" key. Is it possible to set a default zoom out on a div? I use a dialog window to show the div and I want the elements inside to be about 50% smaller then full size.
jquery function .post working on Chrome & IE but not in Firefox
I am using a jquery function with .post for logging in. This function works in Chrome & IE but not firefox. With firefox I have to try login more than once. The username & password are cache so I am not typing them each time. $('#submit_login').click(function(e){ $userLogin = $('#user_login_name').val(); $userPassword = $('#user_password').val(); //alert("in submit login" + $userLogin ); $.post("login_ldap.php", {userLogin: $userLogin, userPassword: $userPassword})
JavaScript function collision?
I have an Adobe Animate CC project that I have changed to make it better. It is problematic because Adobe has not done a good job of generating code that can run simultaneously on a page. I manipulated the code to be able to do this. Understanding a good amount of JavaScript but not everything I can get this to work. The Adobe Animate CC program generates code that is native Create JS. The local script connects to Create JS to make things animate. When I run the code without a JavaScript timer I
hide selected value in other select
hi , is there a way to hide the value selected in other select ? http://jsfiddle.net/buekd25s/11/
innerHTML does not work!
Why does this not work: $(document).ready(function(){ navigationHandler(); headerHandler(); }); function headerHandler() { var titleName = getCurrentSiteName(); console.log(titleName); $('#title_name').ready(function(){ this.innerHTML = titleName; }); } function getCurrentSiteName() { return 'Name'; }
when we move the cursor to particular button (hover), box need to open next to that using jquery
when we move the cursor to particular button (hover), box need to open next to that using jquery. Any examples are there related to that?
What is .resize() at the end of this function?
Hi, I'm trying to understand the following function: function resizeVideofn() { var $allVideos = $( "iframe[src^='//player.vimeo.com'], iframe[src^='https://www.youtube.com'], iframe[src^='http://www.youtube.com'], object, embed" ), $fluidEl = $(".video-container"); $allVideos.each(function () { $(this) // jQuery .data does not work on object/embed elements .attr("data-aspectRatio", this.height / this.width) .removeAttr("height") .removeAttr("width"); }); $(window).resize(function () { var newWidth
How to add data to an existing empty table cell
I have code that does a $.get(urlstring, function(data){ which builds a table. Then I add data from another $.get from another table to add to the div: $('#sampleDiv .testClass').each(function(index){ for each match to the key. This works great for the display on the page, but I have added the tablesorter library to the table, and all of the columns will sort, except for the columns that have been added from the second .get. I'm assuming it's because they are in the div, and not in the table?
Problems with getting class name with hyphens
I have class names like this: <div id="divFirst" class="firstname second-name"></div> And also: <div id="divSecond" class="first-name second-name"></div> This is the result: alert($('#divFirst').attr('class').split(' ')[1]); Output ==> second-name alert($('#divSecond').attr('class').split(' ')[1]); Output ==> Undefined So if the first class name has hyphens then the second class name can't be found. How come this happens? Is there a way to get the second class name if the first one has hyphens?
How can I make this Youtube iframe responsive with jQuery/JS
Hi, Looking for a solution to make a Youtube video iframe responsive I found this page: Fluid Width Video Now I'm trying for hours to apply it on my code example here: Trying to make it responsive but it's not working and I don't understand why it's not. Could you please help me with this? I'm not looking for a CSS solution. I'm looking for a jQuery/JS solution. Thanks
PreLoader wont run on Page Refresh
Hi all, I have implemented a preloader for my site, it uses GSAP and a timeout function to ensure that the animation runs, even if the page has loaded (quickly). However, upon uploading to the server (www.ainsleyclark.com), I have encountered that the preloader doesn't run on page refresh, I can only assume that this has something to do with the set timeout function but cant figure it out. Many thanks in advance. /* PreLoader */ $("#preloader svg").removeClass("hidden");
Next Page