selector info lost after wrap a jquery object
var obj=$(".foo"); console.log(obj.selector); // ".foo" obj=$(obj); console.log(obj.selector); // "" as you see above,the selector info lost after be wrapped why and how to resolve it ?
Problem getting clone section to work
Hi Here is my problem https://jsfiddle.net/mphur5eq/14/ I have two tables on the left section1 on top and section2 at the bottom each section has its own button to insert row section 1 has different number of fields than that on section 2. the problem is when i clicked on New Row on section 2 it clones the row from section 1 which is wrong, it should clone the row of the section where it belongs. can you help me with this? Thank you
Could not complete the operation due to error 8000000b.
We are seeing this error a lot for our users in IE11 and earlier - nearly a 1:1 ratio. After doing some digging it looks like it may be related to comments in the javascript, using: // comment Instead of: /* comment */ Has anyone else experienced this?
Click event lost on clone
here is my problem, when i make a copy of that form to the right the click event is lost on the New Row button to the form on the right. can you help me with this? Here is a working jsfiddle: https://jsfiddle.net/mphur5eq/5/
Quicksand plugin using multiple checkboxes filters
I am not able to pass multiple datatype when more than one checkbox is selected. Please help me out here. if ($filterType == 'All') { // assign all li items to the $filteredData var when // the 'All' filter option is clicked var $filteredData = $data.find('li[data-type]'); } else { // find all li elements that have our required $filterType // values for the data-type element var $filteredData = $data.find('li[data-type="' + $filterType + '"]'); } Thanks in advance :)
Hide after-pseudo-element from all Labels but only for password-fields
Hi, I need to hide the pseudo-element AFTER for all labels which belongs to an input field with a type of password. The markup is: <label for="edit-pass">Password</label> <input class="form-control form-text required error" type="password" id="edit-pass"> To do this I wrote this line of code: $(':password').prev('label::after').hide(); However it doesn't work. I created a PEN for it: Hide Pseudo-Element for labels which belong to a password-field Any help? Thanks
how to get the position of a node in the document?
use $(selector).position() we can get the coordinates of the node relate to its offset parent but how could i get the coordinates relate to the document element?
$.fx,what is fx stand for?
$.fx.step i want to ask what is fx represent
Change icon color of the div after the first one is selected
what I have: the div will change the color after click. what I want to do: the first click will change the background ( I did ) , but the second click will change just the icon color of other div. so if I click in any div first will change the background color ( I did ) second if I click in any other one will change the icon color. as well I would like after the second click, show me a alert saying 'you can just select 2 div at the time' I am very brand new in js and jquery and that was the max I
Using each() for multiple selectors?
Hi, The following code should check each input of type text and of type password and add a class to the input and it's label if the input has a value; But it works only for inputs of type text, but not for inputs of type password!: function showAutoFillValue() { $('input[type=text], input[type=password]').each(function() { var input_value = $(this).val(); if (input_value != '') { $(this).addClass('dirty').prev('label').addClass('dirty'); }
jQuery runs on Load instead of on Click event
Hello, I have the following code: jQuery( function( $ ) { // wc_single_product_params is required to continue, ensure the object exists if ( typeof wc_single_product_params === 'undefined' ) { return false; } // Tabs $( '.wc-tabs-wrapper, .woocommerce-tabs' ).on( 'init', function() { $( '.wc-tab, .woocommerce-tabs .panel:not(.panel .panel)' ).hide(); var hash = window.location.hash; var url = window.location.href; var $tabs = $( this ).find( '.wc-tabs, ul.tabs' ).first(); if ( hash.toLowerCase().indexOf(
[Event Target] Can't identify clicked element id
I'm pretty new to this forum, so Hello Everyone ;) I have written this proto to fadeout/close my "hint/tooltip" div, when i ckick anywhere in the page. Element.prototype.hintClickOut = function(hint_id) { var el=this; $('*').click( function(event) { var e = window.event || event; var targ = e.target || e.srcElement; if(targ.id == el.id) return; $('#'+hint_id).fadeOut(500, function() { $(this).remove(); }); });
Creating multiple filters with checkboxes in jquery
I am working on a portal that allows the users to view, download and share reusable assets. I am trying a add filter functionality to this portal with multiple filters groups. Check the following link for an example of the functionality that I am looking for. http://www.smartprix.com/mobiles/android-os/price-5000_to_10000/samsung-brand?uq=1 Please note that similar to these filters, I am showing the asset count along with each filter. I have implemented the functionality to some extent but the problem
Extract values ou url using jquery
Hi following is part of a url LekshmiTravels/Places.aspx?fplace=Mumbai%20Central,%20 Mumbai,%20 Maharashtra,%20India&tplace=Vikroli%20Station%20(East),%20Vikhroli%20East,%20Mumbai, %20Maharashtra,%20India,&t1=xyz&dt2=klty my requirement is to extract values from this url here fplace=Mumbai%20Central,%20 Mumbai,%20 Maharashtra,%20India there are 3 comma separator in fplace .i need the last 2 comma separator values means avoid mumbai central and fplace should be Mumbai,Maharashtra,India and tplace
How to redirect user who visit the site directly except those who use a hyperlink to visit the site?
Can someone help me with this.The main goal is we have a site that selling greeting cards. we have step by step process that include visiting site one step at a time. what if the user visit the site directly without visiting the the main site. the idea is the user will be redirected to the main site. the simple solution is using meta that will redirect the user but the problem is it also redirect the user who use the main page. Thanks!
Animate background-image size w/ multiple images
I'm trying to animate one of two background-images assigned to a div. The div has initial css of: background: url("/image1") no-repeat 16px center, url("/image2") no-repeat top right; background-size: auto, auto I've tried the following to animate the 2nd image: $('#mydiv').animate({"background-size": "auto, 48px 48px"}, 2000); or $('#mydiv').animate({backgroundSize: "(auto, 48px 48px)"}, 2000); Is there a way to animate the size, can't seem to figure it out. Thanks.
Two Show/Hide password on the same page
Hi, I use the following function to show and hide the password on an input field: Change Password If there is only one input field on the page, it works great. But if I have two input fields on the same page, the problem is that by clicking each of the Show/Hide buttons it changes the status in both fields. How can I separate this, so that each Show/Hide button works only for its own input field? Thanks
My responsive gallery thumbnails only work when I reload the page. Please HELP!
Hello, I am an amature web designer and have a project for a local gentleman's club that I am having trouble with. I have added several gallery pages to this site but the thumbnails only respond after I reload the page. Can anyone help me find out what is wrong? Here's a link to the site: http://srsgraphics.com/luckylady/
how to remove a div tag inside another using jquery
Hi, In my application iam loading another webpage inside a divtag like below $("#ContentPlaceHolder1_txtsource").click(function (e) {
e.preventDefault();
$('#divdistance').show();
$('#divdistance').html('<object data="http://www.xyz.asp" />');
}); this is working fine my requirement is to remove a particular div of http://www.xyz.asp like this $("divdistance").children(".navbar-header").remove(); but not working this should be after loading of http://www.xyz.asp how
Simulate press key of keyboard when click on button
Hello, After much research I request the help of the community jquery I want to use jquery to simulate the keystroke by pressing a button that will fill a text input <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
Input fields validation
Hi All, I am looking for a solution for checking input fields on a simple form (I have got 4 inputs and 3 of them are required - using DNN Dynamic Form) What I would like to achieve is to prevent the user to hit the submit button, as the form opens in a dropdown, and if the user clicks the submit button the page refreshes, givinng the impression for the user that the fomr has been submitted. I have found a solution on stackoverflow and have managed to achieve the following: when the user hovers over
how could it store data in jquery 1.12
$(".foo").data("foo","bar") in high version of jquery,it will add a attribute to the DOM node,named "data-foo" but i jquery 1.12,it won't so i wonder how could it store datas?
i want a 1.12 version jquery with amd defined
hello everyone i want a 1.12 version jquery which is defined as a amd module where can i get it?
Having an Unwanted Scroll Issue
Hello, I am using a calendar plugin called Frontier Calendar and as the title suggests, I'm seeing an unwanted scroll when you click a button. There is so much JS code with this plugin that I have not been able to find any problems that way. I will post what little scroll related code that I've created but what I would like to ask is - is there a way to alert when there is a scroll event or any active scroll events? Or could this be a CSS issue? Here is what I've written for scroll stuff: $("#clearButton").click(function(){
How to Run Query(Select) on JSON Using jQuery Ajax
Can you please take a look at This Demo and let me know how I can retrieve the cost option of each JSON file and selected item from the list which has equal value? var data = { "items": [{ "item": "Item 1", "cost": "100" }, { "item": "Item 2", "cost": "200" }, { "item": "Item 3", "cost": "300" }, { "item": "Item 4", "cost": "400" }, { "item": "Item 5", "cost": "500" }, { "item": "Item 6", "cost": "600" }] }; $('span').on('click', function() { console.info($(this).text()); var item = $(this).text();
I agree popup then enable function
Hi I want to enable a function (or to load a js file in the head) only after a popup open and the condition (I agree) are accepted (onclick) how can I do it ? (stored in cookies or session ?) thank you
Get form input value inside function
Trying to figure out why this input value can't be extracted from this function: function valEmail(selname) { $('form.cd-form input[name^="email"]').each(function(selname) { if (inputck == 1) {return;} if (typeof selname === "undefined") {var email = $(this)} else {var email = $('form.cd-form input[name=selname]'); console.log('Inside Defined'); inputck = 1} console.log('Email: ' + email); console.log('Email val: ' + email.val()); var elen = email.val().length;
Call plugin dynamically
I have this code $(".address-geocomplete").geocomplete({ country: "US", details: ".details", detailsAttribute: "data-geo" }); It works with no problem when the elements were loaded with the document but it doesn't work when the element is called with ajax. I understand I could add the function to the ajax call but that's what I don't want. I would want to write this function once and for it to work no matter if the element was called on the document load or in ajax. Is that possible to do? How? Thanks
After deleting all slides in bootstrap carousel except one slide get the current index of slide present
Hi, After deleting all slides in bootstrap carousel (except one active slide). Not able to get the current index of last slide which is not deleted. How to get current index of the left over slide. i am able to delete slides using the below code but not able to get the current index after deleting a slide using the button click the below code i have used for deleting slides. $("button").click(function() {
currentIndex = $('div.active').index();
// alert(currentIndex);
var ActiveElement = $carousel.find('.item.active');
i need help
i have a problem in jquery i made a category page on it i set a counter it is doing well when i clicking on checkboxes only now i want that when i hover on image checkbox show and when i clicked on image checkbox checked and counter decreased .i have set the counter up to 10 when 10 checks complete button active wait..i have pushed this code on github https://github.com/dsingh110096/category_page_1 please help me i need help
Bug setting width of iframe element on window resize
Using jquery 3.0.0 when setting the width of an element: iframe.width(100px) ;this will work correctly. but if your code within a window.resize function looks like this: iframe.width(100px); iframe.css('padding', 2*10); then the iframe will grab the padding & border, and the end CSS will look like this: width: 142.667px; padding: 20px; JS code: $(window).resize(function () { var frame = $('iframe'); frame.width(100); frame.css('padding', (20)); });HTML: <iframe></iframe>
why doesn't this grep() work?
I've included some js below. Grep examples 1 and 2 work. Grep example 3 does not work. Any idea why grep example 3 does not work? ======= <script src="jquery-3.0.0.min.js"></script> <script> $(function(){ var users = [{ FirstName: 'John', LastName: 'Smith' }, { FirstName: 'David', LastName: 'Johnson' }, { FirstName: 'Bill', LastName: 'Jones' }]; var filteredUsers = $.grep(users, function(user, i){ //1. works //return user.LastName == 'Smith'; //2. works //return user.LastName
Suppose I fill an invisible div with text, then make it visible and try to center it...
Suppose I fill an invisible div with text, then make it visible and try to center it on the screen, both vertically and horizontally. I can fix the width of the div in advance, but I can't fix the height in advance, since I don't know how much text I'm going to be putting in. To get the div height, I do: var divheight = $('#popup').outerHeight() but this returns 'undefined'. to be a little more precise, I have a table in the div, and it has 2 rows with one cell each, and I'm filling the text into
Combining click and enter function to shorten the code
Hi, I need to trigger the same event handler on both Click and also on Enter. To do this I write this code: var showHideBtn = $('.js-showHidePassword'); var showHideSpan = $(showHideBtn).children().last(); var $pwd = $('.engage-password__field'); // On Click $(showHideBtn).on('click', function(e) { $(showHideBtn).toggleClass('toggleShowHide'); showHideSpan.text($(showHideBtn).is('.toggleShowHide') ? 'Hide' : 'Show'); if ($pwd.attr('type') ===
Activate on scroll and change color on click
Hi I want menu lines to be activated(effect like when hovered) on click and activated on each section scroll. Fiddle Link
By pressing the "arrow key down", add a class
Hi, This code should achieve that if I press the "arrow key down" inside an input field with a certain class, an additional class get added to all inputs which have the same class: $('.text-input__field--floated').keypress(function(event) { var key = event.which; if (key == 40) // Arrow key down code { $('.text-input__field--floated').addClass('dirty'); $('.text-input__field--floated').prev('label').addClass('dirty'); } }); But it doesn't
2 document.ready calls
I have a web page that I need to do some jquery and it has to call when the page loads in the document.ready() call, however, the page is also referencing a JS file that has JQuery and a document.ready() call in it. How can I get the document.ready() call to work on page and not error out on the other document.ready() call in the referenced JS file?
[autocomplete] Get an Session value or Variable value in an ajax request
Hello i have a problem .. I made a little "shop" system for representative. They can make orders, this orders be saved on the database with the id of each user. Then they can view there orders. Now i would create a search field with autocomplete where they can filter the orders by customer name . But the problem is that i can´t hand over the session id of the user or a variable. This way the result: each name in the database get displayed. The PHP is working (it display only the correct names)
why jQuery is not always compatible with prevous versions?
Hi, Sometimes I had several issues with some features that it worked properly with previous versions of jquery. For example, in one of the sites I designed: http://www.el-mejor.com/ I had a beautiful jquery effects in the slider and another in the boxes. The problem is when I update jQuery version some features not work properly with the new version and others features works just with this new version. The question: Is possible to make a jquery compatible with all previous versions? I think that
By pressing Enter inside the password field, submit the form?
I'm trying to achieve that if the focus is on password-field (#edit-password), and the user press the Enter key on his keyboard, the form get submitted: By pressing the Enter key inside the password field, submit the form But in my above example it seems that it doesn't matter if the focus is on password field or on any other field, pressing the Enter key will always submit the form! Why is that?
Next Page