Need to append image to to div.
Okay so on click function I do this: var item_img = $('#itemImg').attr("src"); I get the src of the image. And then the problem is that I have more than one item but each item have the same class. So whether I click on second image or on third I still append first item image. I need to get somehow unique image when I click button. This is the code: <ul style="list-style: none;"> <li class="text-center"> <div class="popup"> <img class="item" id="itemImg" src="{{this.img}}"><br> <span class="popuptext"
scroll to Anchor - prevent animation on section
Hi all, Im new to the forum (and somewhat of a beginner to jQuery), and have stumbled onto a problem with a scroll to anchor function. At the moment, when the user clicks an element on the nav bar, the nav bar hides via a GSAP timeline, it scrolls down to the section, then the GSAP timeline reverses the nav animation so it re-appears. What I'm stuck on - is that I cant seem to prevent the navigation animation happening when the user is already at that particular part of the page. For example, if
How to handle jquery Ajax response if it binary large object data type.
hello all I am using $.ajax with GET method to fetch data from server. The data is some file and i am getting binary data. In xmlHTTPRequest, I am able to set responseType to blob, but while doing same in $.ajax, the error event executes even after response is 200 and readyState is 4. this is what i used. $.ajax({ type: "GET", url: fileUrl, success: function(data, jqXHR, response){ var blob = data; console.log(blob); console.log(jqXHR); console.log(response); console.log(((new Date().getTime())-startTime)/1000);
How can i handle synonyms in typeahead plugin?
I just created a search function using the typeahead jquery library. My problem is that when i select an item from the dropdown list it return all the synonyms inside the input field instead of the name of item: In my example if you try to type "Fruits" and select the item from the drop-down list it works ok. But if you try to type "Apple" or "Orange" and then select "Fruits" from the drop-down list, then it returns all the synonyms of "Fruits" in the input field eg "Apple, Orange, Banana". I just
Superfish JS conflicting with the Woocommerce
Hi, We have used Superfish JS in the Wordpress theme. Woocommerce is also installed. When we set the shop to show "Product Categories" from the Customize -> Woocommerce -> Product Catalog. It displays NAN along with the category name. If we remove the Superfish JS it works fine. Could you please check what is the issue? Thanks
How to set/unset active links
I have a set of links (same URL). I'd like to make the following changes to the "li" element when its associate link is clicked: 1) Add a class='active' to li element. 2) Remove the "a" anchor, and keep only the "span" element. **HTML before jQuery:** <ul class="navbar-list"> <li><a href='#' data-id="1" > <span>Link 1</span></a> </li> <li><a href='#' data-id="2" > <span>Link 2</span></a> </li> <li><a href='#' data-id="3" > <span>Link 3</span></a> </li> </ul> Using
re : ON OFF switch Button
hi i am using on/off switch inside table control but when try add new row in then second switch also pointing to first one only. http://jsfiddle.net/RahulKanheya/p89ka9jq/966/
close modal by clicking outside modal
Need help, can not get it working..! Would like to close div by clickin outside this div. Example: https://next.plnkr.co/edit/eOYp60O8UvRgK6Bc?preview
get the position (y corodrinate) of anchor tag passeed in URL
Hi, I am trying to determine the position of the anchor tag in the URL. I tried var element= $('#gallery').find(hash); var loc = element.position(); alert("Pos = "+ loc.top); where #gallery is the id of the div contacting the gallery hash is anchor id passed in in the url When using Firefox's "Inspect Element" and in the console tab I'm getting TypeError: loc is undefined
popover event changing
Hi everybody, currently trying to figure out which event listener has “login” element. Please look here: loadbee.com -> navigation login. <a> has popover method, Login window appear/dissapear with onmouserover/hover(not sure) event, i would like to change this event to Click event, clicktoggle to be exact. Thanks in advance
How to make jquery autocomplete accept the pasted text.
Hi Team, I'd like the jquery auto complete widget to accept the pasted text apart from the selected text. The pasted text is part of the suggestions from a URL.
Referencing the next div after the one clicked.
Hi, I have some html code to display summary log information inside a table inside a div. Each summary div is followed by a detailed information div that is hidden. The displayed result looks like hundreds of rows in a table. The idea is for someone to click on a div showing summary log data and to have the next hidden div to expand showing detailed log information. I have code that works to slideDown one hidden div if another is clicked but I have to use the id of both divs. What I would like is
Issue with autocomplete scroll bar arrow's in IE
Hi, I am facing the issue with Jquery autocomplete scroll bar arrow's. I am using the Lazy loading to load the data in drop down. It is working fine when doing scroll by mouse scroll or keyboard keys. But I try to click on arrow's of scroll bar it will get back to the top. I am not able to go to the bottom of the scroll bar. Thanks Irfan
how to add a class to button Edit, in tableedit plugin
hi all here my fiddle: http://jsfiddle.net/jamiguel77/xdo6czrh/ when user click on Edit button in any row.... i want go to Name column, and change Jhon Name to Mike... when user LostFocus(clicking the button Save Changes) i before want check before the value typed, send the value to ajax and return, if is OK, save the changes if not i want display an alert Thanks
jeditable - catching click event
Hello, I'm using jeditable in relation with dataTable as follow: var tableGrid = $('#grid').dataTable({ "dom": "frtip", "bStateSave": true, "paging": false, "fnDrawCallback" : function() { tableGrid.$('td:eq(6)').editable(function(value, settings) { var td = $('td#' + this.id); displayStuff(td, this.id, value); }, { type : 'text', cssclass
Menu with tabs with jQuery
Hi, I want to navigate the tabs: But when I click on "Description" or "Content" it goes like this and does not come back: How do I get this? Part of the code in php: <script type="text/javascript" src="js/jquery-1.6.4.min.js"></script> <script type="text/javascript" src="js/abas.js"></script> Another part of the code in php: <section id="abas-geral"> <ul class="menu"> <li><a href="aba01">Description</a></li> <li><a href="aba02">Content</a></li> </ul> <section id="box"> <div id="aba01" class="conteudo">
Passing URL parameters through hidden fields
How can I grab a couple of URL parameters and pass them through hidden fields in a form submission? The strings are structured like this: https://alert17.com?sid=TESTSID&wid=TESTWID
How to calculate days interval from a today?
I have these two inputs in the first of which, i have a dropdown with the days and on the other one i have a datepicker formated date. What i want is if i select a value from dropdown to show the date in the datepicker input, and the same backwards. That's my snippet so far, but in the input i get a full fomated date something like, "Wed Apr 03 2019 00:00:00 GMT+0300 (Eastern European Summer Time)".. https://codepen.io/HarrysR/pen/LJaegm Any help on that? For any further clarification feel free
toggle show and hide - shows but doesn't hide
here is my html <div id="space_manager_saved_search_selection"> <div class="saved_filter_tile firstfour" data-filter-id="5"> <h5>john</h5> </div> <div class="saved_filter_tile firstfour" data-filter-id="9"> <h5>christine</h5> </div> <div class="saved_filter_tile firstfour" data-filter-id="10"> <h5>christine1</h5> </div> <div class="saved_filter_tile firstfour" data-filter-id="12"> <h5>johndc</h5> </div> <div class="saved_filter_tile afterfour" data-filter-id="13"> <h5>here
ajax content into dynamic loaded div
My more-news-holder is loaded dynamically, i think this is why when this code runs. my result does not go onto my page. how can i fix this? <div id="more-news-holder"></div> <div class="more-news-container"> <div id="more-news-btn" class="more-news" hreh="#">Get More News</div> </div> Here is my jquery $("#more-news-btn").click(function(){ $.ajax({url: "content/more-news.php?C=" + NewsCount, success: function(result){ $("#more-news-holder").html(result); NewsCount = NewsCount + 30; }});
Catch the ajax response with jquery bootgrid
Hi, I know that this plugin is not from jQuery UI plugins, but it uses jQuery as kernel. The problem I've got with this plugin is that I want to catch the ajax response to analyze it on the loaded handler (loaded.rs.jquery.bootgrid). Does anybody know how to make this? There's a method called responseHandler, but is never executed. Thanks, Dani
How to attach an ID to the showErrors: function in jquery validation plugin
I am using the jquery validation plugin. I have a "showErrors" function to hide a second form on error, and on click of the submit button if the user goes back and modifies the first form and creates new errors. The problem is the second form is also taking on the "showErrors" function. It is hiding when the user clicks the submit for that form as well. I want to attach an ID (#form1) to the "showErrors" function so it ONLY works with the first form. I need to make sure ID (#form2) Does not trigger
Pushing a nested div underneath its ancestor for mobile
Is there a jQuery way to move a nested div underneath its great grandparent for mobile view. Here's what I've started: https://codepen.io/Codewalker/pen/aaPRrz One thought is to create this twice, hiding one and showing the other, depending on the device/width. <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" type="text/css" rel="stylesheet"> <div class="container" style="background:#ddd"> <div class="num-container"> <div class="num-thumb"> <img
Jquery Slide
Hello everboy, my name is Taniguchi and I'm new at jquery and I'm having trouble with the following piece of code. $('#day_slider').slider ( { range: "max", min: min_value, max: max_value, value: 1, step: 1, slide: function (event, ui) { if (ui.value == 1) { $("#slider_value").html('Follow Up in ' + ui.value + ' Day'); } else { $("#slider_value").html('Follow Up in
add class onto an element
Hi, I would like to add a class onto my element saved_filter_tile Although when I try to, it adds the class onto the h5 $("#space_manager_saved_search_selection .saved_filter_tile h5").off().on("click", function(){ console.log("I am here!"); $(this).addClass('selected'); });
Issue with upgrading jQuery
I am working on upgrading jQuery in my application from version 1.11.2 to 3.3.1 Even when .live() function is removed after 1.9, I am seeing it being used in multiple places in my application and it is working also with version 1.11.2 Now, when I am upgrading it to 3.3.1, the behavior that I have seen is that .live() works in some pages while it gives error in some other pages and needs to be replaced with .on() So, my question is: "Do I need to change every occurrence of .live to .on when I am
can't get .indexOf to return expected value
This question was asked, and I would like to include additional info for the solution. Original post: I'm trying to select all elements that has a class that starts with "col-md", but no matter what I do .indexOf("col-md") returns -1. Html: <div class="col-md-4"> Test 1 </div> <div class="col-md-8"> Test 2 </div> jQuery: if ($col.attr("class").indexOf("col-" + val.toLowerCase()) > -1) { console.log($col); } val is "MD" Original post ends here ----------------------------------------------------------------------------------
Converting Web Applicatiion To jQuery Mobile
I have a PHP web application and I want to create a jQuery mobile version - Are the any tools that would do a lot of the work/conversion for me or do I need to rebuild the forms/layout etc from the ground up. The CSS/layout is pretty old so the first instance we wanted to build the jQuery mobile version then detect mobile/tablet devices and redirect them to the jQuery mobile version. 2nd phase is to build the mobile apps for iOS and Android but I'm primarily concerned with creating the jQuery mobile
Javascript to jQuery help?
window.onscroll = function() { progress() }; function progress() { var winScroll = document.body.scrollTop || document.documentElement.scrollTop; var height = document.documentElement.scrollHeight - document.documentElement.clientHeight; var scrolled = (winScroll / height) * 100; document.getElementById("myBar").style.width = scrolled + "%"; } I thought something like this might work : jQuery(document).ready(function($) { $(document).on( 'scroll', function() { if ( $(document).scrollTop()
Help matching button tag and replace its onclick
I'd like to select and match the following button code by the buttonid and replace what's in the onclick with my own url. <button type="button" tabindex="0" title="" buttonid="CTRL53_11" onclick="return (PictureButton.OnClick(this, event));">My Button</button> Can you help me match the <button> tag where the buttonid is CTRL53_11 and replace the onclick to something like window.location.href="custom.html"? I can use something this right? $('button[buttonid="CTRL53_11"]') I'm not sure how to replace
Uncaught Missing instance data for this datepicker
when i am changing date from input then first time it works but on second time it gives Uncaught Missing instance data for this datepicker.
Handling videos in jquery
Hi The purpose of the program is to describe videos with one video. I am also trying to watermark the video being described. The problem is that I cannot load the video from the select tag. Can anybody help? Thanks.
How can I add elements to tag
Hi, I'm trying to generate a 'a' tag with some parameters to call a function which makes a rest call, divHTMLPages = "<a href='#' onclick='getRestResults(" + $('#queryU').val() + "', '" + _reg + "', " + _rowLimit + ", " + previousPageCount + ")'>" + i + "</a> "; $('#pageU').html(divHTMLPages); But the result is not well-formed I see double quotes after getting #queryU.val() and that's not correct, what would be the correct form for doing this? I have read about jQuery .add but not sure this
using validate
Can you allow some fields to be required only in certain situations? I need to have an email field required only if another input is present.
Packaging plugins for npm etcetera?
Hi folks, I've built a number of jQueryUI plugins for creating special purpose interactive scientific visualizations here https://github.com/AaronWatters/jp_doodle I'd like advice on the right way to package the plugins in "state of the art" Javascript idioms so people can use `npm install ...` to install the package or similar. A pointer to a good example repository which is packaged well would also be helpful. Thanks! -- Aaron Watters
Create new tab and rename its title
In my single page application a user can open links in a NEW tab. I would like the tab's title be named based on the particular link they clicked. However, the original tab's title gets renamed. Can someone show me how to rename my "New" tab instead? $("#contextMenu").contextmenu({ delegate: ".hasmenu", menu: [ { title: "Open in new tab" }, ], select: function (event, ui) { var page = ui.target.children('a').context.nameProp; var parent = $(this).closest('div').attr('id');
Variables are being shared across instances
Hi. I'm making a image slider plugin which is working fine with single instance but when I have multiple instances on the page, the variables are being shared across these instances. How do I sandbox them and keep the instances isolated? Here's the code: var slider = $('.slider').mySlider(); ;(function ($) { var defaults = { auto: false, delay: 4000, controls: true, controlsPosition: 'inside', //inside, outside, neighbors prevHtml: '<i class="material-icons">chevron_left</i>',
jquery sumo multiselect
i am using jquery sumo select control and i want to use this control inside table and click on add need to add new row and remove row.but i want to restrict single selection in this. max select option should be 1. user should not alow to select more then one value. http://jsfiddle.net/RahulKanheya/p89ka9jq/944/
Response with empty body - is this a problem?
Hi, I am using Chrome to send a request from the browser to the Micrium HTTP server, which is successfully received by the server and my code on the server side. I call an API on the server side to tell the server that I don’t have any body in response. The server replies to my client (“HTTP/1.1 200 OK\r\n\r\n”) which I am guessing is a correct reply. On the client side where I am using” jquery upload plugin” that plugin calls my “fail” method. I don’t understand why – the reply is marked as successful.
"click" not working
hey i am working on a simple site with 3 buttons and 1 test button. curently only the test button(the x) is coded but it does not work and i do not know why. here is my html code: <!DOCTYPE html> <html lang="nl"> <head> <meta charset="utf-8"> <meta name="description" content="controler"> <meta name="author" content="jk"> <link rel="stylesheet" href="css/styles.css?v=1.0"> <meta charset="ISO-8859-1"> <title>title</title> </head> <body> <div id="wrapper"> <h1 id="first">toggle vizer</h1> <h1 id="second">toggle
Next Page