Jerky sliding animation and transition in JavaScript/jQuery
Im trying to animate or ease the incremental scroll left triggered as shown in the below fiddle, but struggling to find the issue with the smooth transition. Any help would be really appreciated, thank you function scrollRight() { i = (i + 1) % elements.length; jQuery(slider).parent().animate({ scrollLeft: (width) + 'px' }, options.hasOwnProperty('speed') ? options.speed : 1000, function() { obj.find('li:first-child').appendTo(jQuery(slider).parent().scrollLeft(0).find(slider)); if (!pause) timeout
Request with jquery and PHP running jquery function
Regards, I'm adapting a system that uses pure javascript to switch to jquery (jquery-2.1.1.js). I'm having trouble when making a request. In making the request ($ .post () or $ .getJSON ()) to a PHP file for success. But if PHP file has an IF and it has another function or javascript jquery I get an error message. Note: There are no errors in PHP and jquery function is included correctly. Attached is a flowchart of the problem. There is something to be done? I wait anxiously for answers to all!
JavaScript runtime error: Syntax error
I am using Jquery to delete a file but getting Unhandled exception at line 23, column 13751 in http://localhost/Scripts/jquery-1.10.2.min.js 0x800a03ea - JavaScript runtime error: Syntax error whenever this this line get hit $('#TestTable').html(data); Below is whole code $(document).ready(function () { $('.delete').attr('href', 'javascript://'); $('.delete').click(function () { $dialog.data('id', $(this).attr('id')).data('contId', $(this).attr('contId')).dialog("open");
How to set dropdownlist selected index?
Dear All, I have load dropdownlist data using ajax and I want to set 1 item selected after an other button click. but what I try doesn't work, please help. the code I try using jquery: $('#IDName :selected').val() = 2; $("#IDName select").val("2"); Regards,
Important function missing from source code.
Was just going through the source of code datetimepicker HERE . the source code can be seen HERE . now there is this function Date.prototype.dateFormat = function( format ){ //you code for convert date object to format string //for example switch( format ){ case 'd': return this.getDate(); case 'H:i:s': return this.getHours()+':'+this.getMinutes()+':'+this.getSeconds(); /*case 'h:i a': return ((this.getHours() %12) ? this.getHours()
Trying to hide an element and having trouble
I'm trying to figure out what dumb mistake I'm making. I'm trying to hide the contact form name and contact information at the top of the page: http://www.schumacherliving.com/contact/ I installed jquery-1.11.3.min.js in my root folder and then added the below code into my header. I know I am doing something really dumb but can't figure out what it is :/ I would have used CSS to hide it but it uses the same div class as the form below it and I don't want to hide that form. <script src="http://www.schumacherliving.com/wp-content/jquery-1.11.3.min.js"></script>
jQuerys Ajax module.
Hey guys , i have never used much of jquerys ajax module , now i was just going through the documentation for $.ajax HERE . has alot of interesting features eg. statusCode (default: {}) Type: PlainObject An object of numeric HTTP codes and functions to be called when the response has the corresponding code. For example, the following will alert when the response status is a 404: $.ajax({ statusCode: { 404: function() { alert( "page not found" ); } } }); If the request is successful,
How to build a animated button
How would you go about build a button like THIS in a succinct way. ? I know its not an easy task but any ideas/suggestions are welcome :D
jQuery fadeIn fadeOut not workiing in Chrome or iPad
I have 3 tabs on a page that hide or show 3 different Div tags contained on the page. The script works fine in Firefox, but not in Chrome, Safari or the iPad. It looks very clean and direct to me, so I am not sure why it's failing. I am grateful for any guidance that can be provided. jQuery: $(document).ready(function(){ $('#publications').hide(); $('#students').hide(); $('#cv-nav').click(function(){ $("#vitae").fadeIn(); $("#publications").fadeOut(200);
How to get a jQuery slideToggle to work
hi Everyone, I have a project which as some hidden links that I toggle to display. I have a nice neat jQuery function for that. The trouble is that I also have a 2nd link that I cannot get to work for the slideToggle. I know it has something to do with targeting the class "lecture-links" and I have tried all sorts of combinations of "next" "closest" and other ideas but cannot get the 2nd link to work. Below are the two functions. I want them both to slideToggle the "lectures-link" div. The first
Targeting child elements
Hi, I'm very new to jquery and I want to use it to highlight the top-most element (parent) in my navigation list. For instance if i'm on a specific page, and I happen to hover over one of the child elements of the page I'm on I want to be able to change the background color of the parent element that i've just hovered over. Below is the code I currently have, but isn't working. var urls = window.location.href; var pages = urls.substr(urls.lastIndexOf('/')+1); $('ul#nav a[href*="'+pages+'"]').children().hover(function(){
Export as pdf
Hello i create this project but i would like to take button pdf and export the page as pdf,Please help me!!!!!
How to change elements inside iframe using jQuery?
Is there a way to remove footer element inside Gleam iframe? Ortranslate text inside Gleam using jQuery? How can I do that? I've tried it many ways, but unsuccessfully. My website goo.gl/cPuhkY Something like: jQuery(".entry-footer").remove() Try to run it inside console, you will get empty array back. I dont know why. It can reach inside iframe, perhaps. Can someone give me an example (if it is possible) on how to remove that footer on Gleam, or translate text inside of it. Regards
wrap first n words with span
Hey, I want to wrap a certain amount of words in every h1 with a span. The amount of words that I want to wrap are noted in the class of the headings (.hh- n ). So my html looks like: <h1 class="hh-1">wrap the first word</h1> <h1 class="hh-2">wrap the first two words</h1> <h1 class="hh-3">wrap the first three words</h1> <h1 class="hh-4">wrap the first four words</h1> $('h1').each(function() { hhNumber = $(this).attr('class').substring(4, 3); // ?? }); please help! best regards.
Direct trigger jquery function
Hi, I need some help on how to direct call/trigger my jquery function. I'm still new in JQuery. Function: (function ( $ ) { $.fn.ajaxcall = function( options ) { var opts = $.extend( {}, $.fn.ajaxcall.defaults, options ); this.click(function(){ /* DO SOMETHING HERE.... */ }); /* onclick */ } $.fn.ajaxcall.defaults = { /* SOME DEFAULT VARs*/ }; }( jQuery )); My normal function trigger/call $('.ajaxclick').ajaxcall({id:'#id1'}); Inside ajaxcall, it will check for 'click' and do some processing. In
Labels and form elements not spaced properly
On a form, using the following code, I cannot get the label (when matching it's "for" with the form input element) to render directly on top of the input element. There is a space or what appears to be a space. <div data-role="content"><!-- content div --> <p id="sessioninfoforemp">New Session Info for Employee Name</p> <div id="forsessionform"> <form id="sessioninfoform" method="post" novalidate action="submitdata.php" data-ajax="false"> <label for="sessionstarttime">Start Time:</label>
Push value in an empty array from checkbox selection
I am retriving some JSON data from an API using Jquery AJAX and I want to change the url dynamicly on checkbox selection. I have four checkbox and I want to store checkbox value to an globle array. When I put console.log(category) or ajax code inside function its working but when I puth the code outsite the function its not working. var category = []; $(".ckbox").click(function() { if($(this).is(":checked")) { category.push($(this).val()); } else { var x = category.indexOf($(this).val());
trying to test of checkbox is checked
from my form: <div class="field" id="free_shipping"> <input type="checkbox" name="free_shipping" id="free_shipping">Free shipping </div> from my js: $('#free_shipping').change(function(e) { if ($('#free_shipping').prop('checked')) { $("#shipping_cost").hide(); } else { $("#shipping_cost").show(); } })
Code Injection in Jquery files
Hi Friends, We are facing code injection vulnerability in the jquery script files(jquery.tablesorter.min and BackOffice-pageEnd-all-min ). In HP fortify report, the code injection finding in set Timeout function. jquery.tablesorter.min setTimeout(function(){$(table).trigger("sortEnd");},0); setTimeout(function(){setHeadersCss($this[0],$headers,config.sortList,sortCSS); appendToTable($this[0],multisort($this[0],config.sortList,cache));},1); BackOffice-pageEnd-all-min setTimeout(function(){$(table).trigger("sortEnd");},0);
mutliple image upload problem
hey guys, i've been working on a multiple image uploaded but i'm having trouble running the script when selecting multiple images as it will only upload 2/3 out of 9 images for some strange reason when i try to upload files singularly then all 9 will upload perfectly. i'm getting no errors in my server log also, so it must be something wrong with my script somewhere if someone can point out where I'm going wrong please. when user selects image(s) $('.upload-container').on('change', 'input[name="images[]"]',
.replaceText only working in one instance of the word
Hello everyone. I am making a plugin (for google chrome) that replaces certain words with others and so far I have got it to work for one instance of the word in the text. For example, in the code I have below, it will replace the word "said" with "forgot" but if the text contains the word "said" more than once, it only acknowledges it once. I tries using /g and /gi and maybe I am doing it wrong but it isn't working. Could anyone point me to a solution that doesn't involve completely uprooting what
How to use $.ajax with a dynamically created form
I would like to submit form data using $.ajax from a form that is dynamically created. The dynamic creation process is successful and I have created a button that, when clicked, will call a function that will handle the ajax submission. The question I have is how to call the function and/or the $.ajax functionality from the dynamically created button, since it doesn't exist during $(document).ready or $(document).on('pagecontainershow'). MP
Exception Handling with php
Hi There, I want to ask how to handle some exception in middle of the process (I'm working with PHP). my js is : $(function(){ var request; $('.naviref').on('click',function(){ if(request){request.abort();} request = $.ajax({ url: "html.php", type: "post" }); request.done(function (response, textStatus, jqXHR){ alert(response); var text = JSON.parse(response); alert(text); if(text.error){ alert(1);} }); request.fail(function (jqXHR, textStatus, errorThrown){
Multiple javascript files conflict - jQuery.noConflict()?
Hi, I'm currently making a form for uploading new members to a web page.I built the form using JotForm which includes js files for controlling the style (hide/show fields, fields that are required turn red, etc.) The js for this form worked fine on its own, but I also included a picture crop/upload as an extra. This also worked when I was testing it in a separate web page on its own, but now combined with the form, the js conflicts and I don't know how to stop that. My script head section looks like
Change function dynamically
Hi there, I'm using a function that hides and shows content. $('.new-customer-details').enableValidators(false); $('.quote-customer-select select').change(function () { var selected = $(this).find(':selected').val() if (selected == '-1') { $('.new-customer-details').slideDown(); $('.new-customer-details').enableValidators(true); } else { $('.new-customer-details').slideUp(); $('.new-customer-details').enableValidators(false); } }) In my example
SlideToggle only the first direct element?
Hi, Could you please check this out and let me know why by clicking on a li element all .hiddenDivs open? CodePen Example I want to achieve that by clicking on each li element only the next direct .hiddenDiv element of it opens and all the other .hiddenDivs remain hidden. CodePen Example
Update height of div when height changes
Hi, I currently have a div which i am getting the height off. Current height is 72 pixels when the height is equal to or the same as 72 i display "20" when the div goes over 72 pixels i want to display "25". I have done this so far but want the height to automatically change to 25 when the div goes bigger than 72. $(function(){ var height = $(".input-container").height() $("#SignHeight").text(height); if (height <= 72) { $("#SignHeight").text('20'); } else { $("#SignHeight").text('25'); } });Any
Distinguish between different reasons for failed AJAX requests
I have a question regarding an issue I ran into, which is connected to these two tickets, which got rejected: http://bugs.jquery.com/ticket/12675 http://bugs.jquery.com/ticket/13171 How is it possible to distinguish a failed Ajax request, which failed because the user navigated to another page, from Ajax requests that failed because of errors, not directly triggered by a user action. Currently I see no way to do so. To reproduce: 1. Navigate browser (tried Chrome 46, Firefox 42) to http://jquery.com
Access to assembled html using .append
I am trying to use the jquery.append function. I am curious as to how the results of the .append activity can be viewed, particularly when there is problem with the script being used as input in the append function. What tool or tools must I use in order to see the built html code in the DOM? Any help/guidance on this matter will be really appreciated. I have searched the posts, but I am not sure what keywords will zero in on the proper help. Alastair
Submit Form - With Two Forms On Same Page
Hello, I'm looking for correct way to handle form submit where two forms exist on same page on the same page I have a contact form with <form class="form form-validation form-contact" method="post"> which I want to post to contact.php and also a newsletter sign-up form where I just want to email the data: <form class="form form-validation form-newsletter" method="post"> which I want to post to newsletter.php Jquery as follows is working to submit the newsletter signup forrm but I can't work out
JSONP doesn't work from Windows 2012 server
Moved a web site from a windows 2008 R2(IIS7) server to a 2012 R2 server running IIS8.5. This web site uses jquery.jsonp strategy to access a web service on a different domain. It doesn't work anymore. In fact any web site on the 2012 server will not access any url from a different domain even if the different domain web site is on the same 2012 server or on the old 2008 server. The same site works from the old server or from a development machine running windows 10. Both of which will find, access
How To Create Dynamic Variable On The Fly Base on Array of Element and Then Truncate It
I am trying to send an array of Messages trough PHP SMS library but there are a limit of 150 character in each delivery time. so I am thinking to slice the array to several message and send them one after one. Here is the Array which I have var sms = [" 1. Head west on Whiteley Ct toward Whiteley Ct (48 m)", " 2. Turn right to stay on Whiteley Ct (0.1 km)", " 3. Turn left onto 27th St (0.2 km)", " 4. Turn left onto Lynn Valley Rd (0.9 km)", " 5. Turn right onto the ramp to West Vancouver (0.3 km)",
Rerender an iframe
I have the code for an iframe that sets its width automatically when the page loads. I built the site with a responsive web design and unfortunately this iframe does not allow me to dynamically change its size at the media queries breakpoint? How can I make rerender plugin with jquery at media queries breakpoints? Is it possible or i have to reload the entire page? Thanks! Manuel
Having Issue on Wrapping Last <td> of Each Row in ( ) on The Fly
Demo I am trying to load each row of a table in element of an array using this code var arr = []; $('#authors tr').each(function () { arr.push($(this).text().trim().replace(/(\n)/g, ',')); }); console.log(arr); But I need to wrap the last <td> of each row in ( ) then I tried to add () like this $(this).find('td:last').before( "(" ); $(this).find('td:last').after( ")" ); This is doing the job but it actually adding () to the table which is not required. Now can you please let me know
Onclick button show div (the div should hide the button in the process)
Hey all i have div and within this div i have a form. I want to show this div when a button is clicked. This all works fine but i also want the original button to be hidden when clicked upon (basicly i want the div to be on top of the button hiding it) When the div is closed (by completing the form or clicking on the hide button i want the div to dissapear and the button to reappear (all without realoading the page) How can i achieve this. <div id='d1' style="display: none;"> <form> <input type="text">
why duplicate my code $.each, please help
hi. I have problem with my code, need to compare to arrays, and next compare my two arrays, this result append in a div, my problem code is here: array1, array2 for( i = 0; i < array2.length; i++ ){ if( array1[i] == array2[i] ){ /* in here is correct*/ console.log(array2[i]); /* is correct just show me two elements*/ //console.log(arrayh3.length); // the problem is below code this repeat two times in div.prometheus-about jQuery('.prometheus-about > h3').append('<div
How to move a div from right to left when page is being scrolled down?
Hi, I want to move a div from right to left ,when page is scrolled down .I am new to using jquery and i got some code from jsfiddle ,which i tried to use ,but unable to get desired solution.The div element is nested inside other div elements ,does that also effect the transition? Any help would be gretaly appreciated .Thanks <script src="js/jquery.js"></script> <script src="js/jquery-migrate-1.2.1.js"></script> <script src="search/search.js"></script> <script src="Scripts/jquery-ui-1.11.4.js"></script>
.attr should allow function that returns multiple attributes
.attr should allow the following type of use: $(selector).attr(function() { return { attr1: value1, attr2: value2, ... }); Currently a function can only be used with the two-argument form, to compute a single attribute.
Method scrollTop() - works wrong in Internet Explorer
Hello Everyone, I am facing an issue with the method "scrollTop". I have 2 div tags what are the same sizes of height, width and the vertical scroll bar. when I scroll the first div, I want that the second div is also scrolled in the same position with the first div . I implemented this by the way: $('div_id2').scrollTop($('div_id1').scrollTop()); It works fine in Firefox and Chrome, but I got a small position deviation between 2 vertical scroll bars of the div tags in IE . when I try to log
Jquery Mobile Site acts Funny
Hi, I want to ask why this site acts funny! The buttons of listviews is jumping up and down...! any reason? http://www.jassimrahma.com/temp/mobile-site-problem.swf This website is at www.mesk.online Thanks, Jassim
Next Page