detach and insert after
My goal is to remove 2 sections if someone resizes a window to less than 647px and re-add them if they resize to at least 647px. The code I have to remove the sections has worked great, but adding them again is not going so well. I cannot do this with a media query because of a plugin I'm using. Here is what I have so far: // CHECKS WINDOW SIZE AND ADDS/REMOVES MUSIC & PHOTOS var $window = $(window); var $pane = $('#pane1'); function checkWidth() { var windowsize = $window.width();
Trigger click not working
Hello everybody, I want to trigger a click on https://shop.adidas.ae/en/stan-smith-shoes/S82255.html (to make a shoe bot). Why does this code not work to trigger the size type button? setTimeout(function () { $('select.product-type.js-size-type').trigger('click'); }, 1000); This is the select button: <select class="product-type js-size-type"> Thanks in advance!
Having Issue on Creating Plugin with Multi Function
I am trying to create a custom plugin to update #result value from an option by a plugin functions at This Demo (function($) { $.fn.app = function(elem) { var elem = $.trim(elem.attr('id')); elem = "#" + elem; var elemTop = $(elem).offset().top; function underone() { } function undertwo() { } }(jQuery)); $("#mapper").app({ underone: function() { $("#result").html('Box is Under 1000 '); }, undertwo: function() { $("#result").html('Box is Under 2000 '); } }); but not sure how to handle the functions
Add class every 4th,5th,6th,10th,11th,12th etc...
Hi, i have an unlimited grid of divs in rows of 3. How would be the best way to achieve adding a class to the 4th, 5th, 6th, 10th, 11th, 12th, 16th, 17th, 18th..... etc... div? i don't believe this is achievable with the:nth selector? any help appreciated.
How to select the 2nd element of a type
Hi, I wrote the following jQuery script...and it's basically working. Note that it's in Drupal so the beginning and ending syntax is a little odd. Please focus on the content between $("A").each(function () { and }); // used to change background-color of currently selected link (function ($, Drupal) { 'use strict'; $("A").each(function () { if (this.href == document.URL) { $(this).parent().css("background-color", "#c03c03"); $(this).css("color", "white"); } }); })(jQuery, Drupal);
I'm having difficulties on getting toggle function to work for clicking on images
So I have a bunch of clickable text. When I click on a text it reveals an image and when I click on the image it collaspes back. I got this working with the slide toggle function but my code is written in the way that all the images reveals itself and not just the one that was clicked. I'm not sure how to get it working where only the clicked text reveals the image and not toggling all the images on the page as it's curently doing. HTML: <div class="page"> <p>
Using Jquery for a cascading dropdown in sp2010 and spd
I have a main list that with a newform.aspx that I would like to add two cascading dropdowns too. Dropdown one would be Gates and Dropdown two would be Milestones anyone have a usable example for this? Thanks in Advance
id^ selector fails with sequential id values
With elements using id values numbered for their 'rows', the following occurs: //for some reason, the following line fails to set the numbered fields //$('input[id^="posn_numb"]').blur(function(){getSuffixNum(this)}); $('#posn_numb,#posn_numb1,#posn_numb2,#posn_numb3,#posn_numb4,#posn_numb5').blur(function(){getSuffixNum(this)}); $('#posn_numb6,#posn_numb7,#posn_numb8,#posn_numb9,#posn_numb10').blur(function(){getSuffixNum(this)});
AJAX call prevents Jquery pagination
Hello, I have implemented pagination in MVC application. when first time page loads, it binds paging number in the bottom, but when I click on paging then it makes AJAX call and bind the data in my HTML table from json response. but after AJAX call, pagination is not working and reload the page and data again and reset pagination to Page number 1. once AJAX call fires, then pagination is not working. <table class="table table-striped" id="tblJobs"> <thead> <tr> <th>Job Title</th> <th>Start Date</th>
How to validate input field within fieldset dynamically
Hi i'm still new in jquery, i need to validate the field within fieldset dynamically without calling specific Id. here is my code jSfiddle As you can see, on the 1st page, when click continue, error on the 2nd page also will enable because on the part i pass the variable on visible fieldset still not success. any idea to solve this issue? and please suggest the improve code to eliminate repeating line of same code. I cannot use available jquery plugin because in my code have select list which is
Add Default Search and Arrow in Jquery Grid
I have a jQuery Grid that I ma using in My MVC page, it will sort Grid when I click on any Header. What I need is to have a default Sort by FullName when Grid Loan. Not sure where I have to Identify the Default Sort. Also I need to have arrow by each header so it shows up Arrow ot Down Arrow if the next Sort would be Asc Or Dec, not sure ho to add that. This is my Grid code: I have a jQuery Grid that I ma using in My MVC page, it will sort Grid when I click on any Header. What I need is to have a
Faire fonctionner mon script autant de fois que possibles
Bonsoir à tous, Si vous voulez, j'ai dans une page des liens ancres qui lorsque l'on clique sur l'un d'entre eux, permettent l'affichage d'un contenu dans une div respective. Toutefois, je viens de générer des liens se disant "des raccourcis" qui permettent en fait de faire exactement la même chose que les premiers, mais le code généré pour ces derniers ne semble fonctionné qu'une seule fois : en effet, au deuxième clique sur un lien raccourci, je ne suis nullement redirigé, il ne se passe rien.
Check all item will enable select all checkbox
Hi Example i have 2 or more set of checkbox list, then I want select all will be checked after all item within <div> checked. here my code https://jsfiddle.net/jCos/feqqs3ne/ The problem is in else line where i declare var areAllChecked. Confuse how to do only effect within div. Thanks in advance.
Passing object (array) ob form element IDs as function parameter and accessing via jQuery
Hi all, up until now I have been able to pass the element ID of a form element to a javascript function and access via jQuery as follows: var elem_id = document.getElementById( 'my-form-element' ); doStuff( $( elem_id ) ); ... function doStuff( $elem_id ) { $elem_id.val( 'Text' ); } ...this all works fine. However, now I have an object of element IDs that I want to pass and cannot access the individual elements via jQuery. I have tried the following: var elem_ids = { first_id: document.getElementById(
How do I change :before element to match changing background color
I am trying to change a :before element to match the color of the changing background element but I am unsuccessful, can anyone provide some working code to make this work, I have been working on it for hours, here is my codepen: http://codepen.io/cabplanalp/pen/b175602bd5be382579f1796be6cbb943/?editors=1111 It is for that first row of gray elements, the second row is hard coded, trying to automate.
Assign arraylist to different place
Hi I have the select list using ul li, when i press reset button, the value for the first <li> will display again for every list. It that possible to do base on sequence without refer to id? here my code https://jsfiddle.net/jCos/e98mp0jp/
Help with click() and second click
Hello, I have my code: $('.menu .toggle').click(function(){ $('.menu ul').animate({ top:0, }); $('.menu ul li').delay(300).fadeIn(500); }); The animation works great. Now, how can I hide the element? On second click simply I want to change the css of menu ul into top:-300px.
Not Returning Location
The script below works great as it returns data except the location, which is sent from the server. It return null. Even when I try calling getAllResponseHeaders() function, Location is not listed. Can you give an idea on how to go about this? $.post(uri, credential, function (data, textStatus, xhr) { //Let's check status code // add spinner to indicate something is happening var target = document.getElementById('login') var spinner = new Spinner(opts).spin(target); if(xhr.readyState == 4) { if
Hide/show a pop-up on clicking the corresponding user when sorted
I'm trying to hide/show a user's pop-up which opens up on clicking it's corresponding user. This works when the users are not sorted alphabetically but do not work after sorting. HTML: [CODE] <body> <section> <header></header> <main></main> </section> </body> </html> [/CODE] CSS [CODE] body { padding: 0; margin: 0; } html { box-sizing: border-box; } *, *:before, *:after { box-sizing: inherit; } main .wrapper { padding-left:3px; display:
How to scroll to an anchor inside <div> with html loaded via .load() jQuery method?
I have found many answers on stackoverflow to a similar (but actually much easier) question of how to scroll to a given anchor in the main body. This is easy: var off = $('#id').offset().top; $(body).scrollTop(off); However, in my case the situation is more complex. Imagine a <div> (with id of 'col1txt') in the main body which has html loaded into it via .load() method like this: $('#col1txt').load('text.html'); Now this 'text.html' has an anchor <a id='id'></a> and if I point the browser to 'text.html#id'
Issue with multiple simultaneous ajax requests with one call back
Hi, I'm having issue populating the html responses in 4 separate div's. All the responses are getting populated in the same div and overriding previous ones. Please assist. Sample here Thank you!
Execute a function after another function is processed completely
Hi folks, I cannot solve a problem dealing with deferrers. The goal is to wirte two function to be executed subsequently, one after another. I have elements, and the functionality should be 1. to show additional content as one clicks onto the element 2. by clicking the same element, the content should not be displayed anymore 3.Clicking an element while another one's content is shown should lead to the function to remove the other content FIRST and THEN show the clicked element's content. There is
Ajax request to php with empty POST data
Hi, I'm trying send and http request with some data and file to upload to an php server, but server receive empty data or is unable to parse it. I suspect that there is something that I can't understard with multipart data requests but I have no idea what can it be. The inspector reveals that post data is sending ok, but in server has empty $_POST or $_REQUEST. Is the Ajax request well configured to upload data and files? Thanks in advance. html =========== <form id="idform" method="post" enctype="multipart/form-data"
nav-bar bug in new versions of ios
Hello. I have an app that I made 3 years ago. The nav-bar worked perfectly when compiled in older versions of xcode. Recently I compiled my jquery code on apache cordova 6.5.0 and xcode 8.2.1. The code compiles fine, and 99% of the app is functional, but there seems to be a bug with the nav-bar. If I load a page, and scroll, the nav-bar seems to do what it should, it stays locked, and the main page data will scroll properly with the nav-bar fixed. However, if I let the page load, and perform
redirect dynamic to parent site
Hi I wanted to create a link that is dynmaic in my site. The name could be 'Go Back', but it should not use go back history, I want the link to get up one level strict according to the nuber of slashes in the URL, e.g. in the structure of sites and pages I got, For example: If the I click such link on this page: https://forum.jquery.com/using-jquery/newtopic (I should be redirected to.. ) https://forum.jquery.com/using-jquery Or.. If I'm at this level.. https://forum.jquery.com/using-jquer (I should
Simultaneous action
Hello, How to make that all happened together? $('div').animate({
backgroundColor:'black'
});
$('div').slideUp();
How to combine 'document' and a class selector?
The manual describes the use of "Multiple Selectors" here: https://api.jquery.com/multiple-selector/ It says that one can simply combine them like this "sel1, sel2, ...". But if one of the selectors happens to be document (no quotes), then this combining doesn't work. Consider the following code which works perfectly fine: $(document).bind('keydown', 'f1', function() { $('#help_button').trigger("click"); return false; }); $('.entry_fields').bind('keydown', 'f1', function() { $('#help_button').trigger("click");
Selection of div with title
I've got a div with a complex title <div title=" 00:00 - 23:55 [Holiday] and some more text">...</div> which I need to filter on the keyword e.g. [Holiday] or just Holiday and set a css property. This dosn't filter the right div: $("div[title$='\\[Holiday\\]']").css('background-color','red'); Any idea?
swipe gestures, compatibility
Hi i'm using jquery v1.11.1. Now I'd like to enable swipe-gestures. Is it correct that - swipe gestures are only supported in jquery mobile? - only version 1 of jquery supports IE6 to IE8? I tried implementing jquery mobile (latest stable version), but I experienced problems like huge breaks in the page, a "loading" bar on bottom of the page and when I used links, the page to follow was loaded below the current site. So I guess there are compatibility issues with v1.11.1 and jquery mobile. Is this
Passing php to jquery
I have a PHP variable called $successSent I have this bit of jquery $(document).ready(function(){ var success = '<?php echo $successSent; ?>'; alert(success); }); But alert(success); says <?php echo $successSent; ?> not the value of $successSent. I though you could pass PHP to query that way? What am I doing wrong? Thanks
Using jQuery to force div to reload
Good day all, Currently, I am working on a project where you arrive on a page that has a list of Annual Reports. The user has an option to add to this list. If they click the Add Annual Report(s) button, a modal window will appear. Within it, you pick a status of the Annual Report (only two statuses: Projected and Actual). 1.) Projected: picking this status causes another div to be set to show(), which contains a date picker for a Start Date, and a dropdownlist for End Year. 2.) Actual: picking
Convert syntax .live() to .on()
I have been given a web site by our organization to maintain that uses jQuery 1.7.2 and would like to remove a deprecated function .live() so I can move forward with later versions of jQuery. I have searched the web for changes to the syntax and thought I had figured out the changes I needed(that worked elsewhere) until I came to this line of code. This code is part of a form where input is verified before moving to submission of the form to PayPal. The characters in red have a VS 2013 warning "Variable
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
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.
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;
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()"
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,
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
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!
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
Next Page