menu_hover,js upgrading from JQuery 1.7 to Jquery 3.0
I am stuck updating the menu_hover.js file as the Jquery 3 no longer supports browser.msie. It was dropped as of Jquery 1.9 and is no longer supported. Can somebody please help me replace / redefine the following line, which is the problem. if ($.browser.msie && $.browser.version.substr(0,1)<7) here is the original menu_hover.js file: // JavaScript Document // menu_hover.js $(function() { if ($.browser.msie && $.browser.version.substr(0,1)<7) { $('li').has('ul').mouseover(function(){ $(this).children('ul').show();
Add window width to URL on resize
Trying to get jQuery to add current window width to URL on resize. It keeps reloading on mobile devices. How do I solve this problem. My code looks like below. $(window).bind('resize',function(){ if (window.location.href.indexOf('reload') === -1) { window.location.replace(window.location.href+'?reload' + ($(window).width())); } else { window.location.replace('?reload' + ($(window).width())); // With current width } });
enable/disable textbox based on select box selected value
What is the best way to enable/disable a textbox based on the option selected in a select box. I don't want to do it based on onchange event of the select box. It should be something that should be in effect right from the beginning when the page loads. Thanks.
How do I sum dynamically loaded table column using jQuery?
I have a table. http://www.jonathanryangrice.com/trips/tt-trips.html I'm trying to sum the Total (7th) column and display the result in the element with the ID #weektotal. Any help will be appreciated.
Ajax and random function
Hi all! I try to do some ajax call and have in my example three entries with some text content. What I try to do is to randomize one of the three items I get back. It works sometimes, and sometimes now when I do a page refresh. Btw in real cases it could be more than three items. What have I missed here? Thanks in advance! function successFunction(data) { var numberOfItems = data.d.results.length; for (var i = 0; i < data.d.results.length; i++) {
function not modifying elemt properly
Hi, I have defined a function which gets JSON arrays and converts them into options for selects. Actually it does what it should do but only with a kind of workaround. I want to call the function like $('#select_client').changeSelect(url, route); But I am only able to call the function like $().changeSelect(url, 'client', '#select_client');Where is my mistake in the handling of the variables in the function? Here is my function: $.fn.changeSelect = function(url, route, field){ $.getJSON(url+route,
Set active page nav title to div
Is there a way to display the title link attr to a div when href is active/highlighted http://new.e-storas.com/resources/litriche/index.html Here's the code I've done so far but its just returning the first href link var getTitle = function (el) { return $(el).attr('title'); }; $('#site-title').html(getTitle('a'));
get data from database to the text field
I have 2 text fields, where it should shows the data from the database. I also have a dropdown list (Region) & currency type (currency). so when I select the region from the dropdown list, the currency changes accordingly. like if I choose US, the currency should change to USD, for UK its changes to GBP, for EU it changes to EUR, but for the rest it is USD but the prices are different for all the region. here is the code for the region & currency. <script type="text/javascript"> $(function(){ $("#country").change(function()
script doesnt work in Chrome and Opera when the tab lost the focus
Hi everybody. I use it in all my web projects, and frequently I donate money to the project because I love it. Now I discovered an issue in my last JQuery script. I setted an setInterval every 1 seconds that call an $.ajax function. The problem is that all works correctly in Firefox and IExplorer navigator, but the script doesnt work in Chrome and Opera when the tab lost the focus. Somebody can tell me an alternative that works in all navigators? Thank you a lot!
show total price
hi there I have 3 text boxes, one for show price, other for quantity & the last one is for Total price. I load these data from the database, the default quantity is always one. but the user can change it. what this code does is, it loads the price from the database, and shows the quantity "one" but does not show the total price, I have to change the price manually & only then it shows the price. please help me here is my code. $('#deviceunitPrice1, #devicequantity1').change(function(){
var rate
How to apply a click()?
Assume I have the following HTML structure: <div class="aaa bbb"> <a id="ccc8888" class="......." href="javascript://"> <span class="ddd eee">click here</span> </a> </div> .... <div class="aaa bbb"> <a id="ccc7456" class="......." href="javascript://"> <span class="ddd eee">click here</span> </a> </div> When the users clicks manually with the mouse on "click here" text then something is expanded on webpage. How do I simulate a click on ALL/EACH (!) such items on a webpage? The items
Jquery and input elements of type password and email
Hello, I have a question regarding verification of input element values. Currently, I set the value of the designated inputs (both email and password) for automatic login. I want to verify the content of each element before I automatically submit the form. So the code I have in place is like this... // Set value var u = $('control-id'); u.focus(); u.val('myemail@domain.com'); // Verify value if (u.val() !== 'myemail@domain.com') { console.log('FAIL val = ' + u.val()); } So most of the time I will
jquery .css not working
Hi, can anyone help me? I am using jquery on this page http://xtremecsc.ie/cashel/ Under 'meet the team' when you click 'view profile' a pop up should display. It was working fine before, now all of a sudden it isn't. Here is my code: <script type="text/javascript"> $(function () { $('.popup').css({'height':(($(document).height()))+'px'}); }); $(function () { $('.profile').click(function () { $(this).parent().find('.popup').css('display', 'block'); }); $('.bio-close').click(function
JQuery Ajax tabs - I want to add a select form
I have a problem with jquery tabs. Here is my page: http://z-fan.cz/jtabs.php After selecting city in the select form I need active tab to be dynamically reloaed, so as the links in other tabs. Each tab is loaded from jtab.php (in the same directory) with get parameters (jtab.php?color=red&city=all ). Can anyone help me? Thank you very much
How to fix the functionality of toggle button of mobile menu.
I am turning the PSD design to responsive template for online store. Here is link. I came across to the problem. There is a confuguration menu(config panel) on the left sife for choosing and filtering the desired good.When clicking on config panel toggle or on any items of config panel , config panel opens or closes. You can see the action visiting the link. But on mobile version, config panel is hiddedn by default. Only clicking the appropriate button reveals it. I embodied this by adding '.show'
Problem with second execution of js function.
Hi, I need your help because it happens that in a js function return a value from a file php. This php file is executed via ajax and on success I check the value. At the first execution it returns the right value, after the next exections it returns always the same value. I have to refresh the page to have the right execution. This is part of the function: $.ajax({ type: "POST", url: "prenotaVerifica.php", data: {preMateria: preMateria, preIdClasse: preIdClasse, preClasse:
not showing all checkedbox function
HiI have a table with checkboxes, there are 3rows (including heading) & 4 columns (including checkbox). when I checked the checkbox for a row, then it will show the dropdown list, else the dropdown list will be invisible. this works fine for me for each of them but when I try to "select all checkbox" from the top, it select all the checkboxes but does not show dropdown list. function valueChanged()
{
if($(".checkezspeedkit").is(":checked"))
$(".qtyezspeedkit ").show();
else
$(".qtyezspeedkit").hide();
}
function
My Code Not Working
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js'></script> <script type="text/javascript"> for (var i =0; i>=50; i++) { var pos=($("portfolio-items").eq(i).position.top)+($("portfolio-items").eq(i).height())-($("portfolio-items").eq(i+4).position.top); $("#div").eq(i+4).css("margin-top", pos); } </script>
using new Features of jquery(2.2.1) in old version of jQuery (1.4.4)
One of my client is using drupal cms for his website . drupal uses jquery version of 1.4.4 . I have build a pulgin which is using jquery of version 2.2.1 .Whenver he install my plugin he got the error of Uncaught TypeError: $ is not a function(…) when i link jquey version 2.2.1 my plugin works.he dont want to upgrade the jquery version . is there any way he can use my plugin in jquery veerion of 1.4.4. He also dont want to include 2 jquery as it will increase the load time of his website. please
item selected in checkbox & show/hide
Hi I have the following code. this works only for one row. I want this should work for both rows & also if I select the top checkbox, then it should select all the checkboxes to show all items in the table. there are Qty & Option column, I want these item should not be visible until I select the checkbox. <!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"> <head> <meta content="en-us"
code.jquery.com CDN is down!
I'm getting too many redirects when trying to pull code.jquery.com/jquery-1.12.4.min.js Been working for years, looks like it's been broken for about 15 minutes now. Pete
Loop Finder
Hey everybody I need to write a script using jQuery, but am totally stuck on how it would be possible. If you checkout my example HTML code below, you will see that it is a series of DIV's. The DIV's are all linked, for example; * The DIV with ID 111 is connected to the DIV below, because that DIV has a "data-one" value of 111 * The DIV with ID 222 is connected to the DIV above, because that DIV has a "data-two" value of 222 Basically the DIV ID values are linked to another DIV by reference of either
jquery autocomplete update of multiple fields
Hi, I wonder if anyone can help... I have adapted the jquery autocomplete to update multiple fields on autocompletion of the source field which in this case the id of the input field is Company. As an example the additional input fields have an id of Telephone and Mobile. When i run the example the auto complete picks up the relevant data from the database table and subsequently populates the Company field wen a value is selected. However the values of Telephone and Mobile do not populate. I have
How tosecurely append items securely with Jquery
Hi; What's the right way of doing this without breaking the page and dealing with XSS? var str = $('#embed_text_input').val(); if (str.toLowerCase().indexOf("apple") >= 0) { var embed_button_title = "Apple"; var icon_value = "fa-apple"; var found = true; } var append_item = "<div id = \"full_embed_button_"+embed_button_id+"\" class=\"input-group\"><span class=\"input-group-addon\"><span class=\"fa "+icon_value+" \"></span></span><input class=\"form-control btn btn-default\"
Jquery code for persist hiding table rows upon dropdown selection or checkbox checking
I have no clue how to write the code for that. I got the checkbox and selection persist down with help of this community, but i get the feel the code for persisting hiding table row will be very different. can you give me some hints?
upgrade from 1.6 to 1.12 question
Is there a quick and easy guide that can list the changes from 1.6.x to 1.12.x? thanks
FormData problem
Hi, I'm trying to send uploaded files without form using Ajax. I've a problem with FormData. Here my example: HTML <input type="file" name="file" class="jfilestyle" data-theme="blue" data-input="true" data-buttonText="<i class='fa fa-upload' aria-hidden='true'></i>" >JQUERY: var myfile = $(':file').prop('files')[0]; var data = new FormData(); data.append('file',myfile); var mytest= "test"; $.ajax({ type:'POST', url:'test.php', data{ data:data, mytest:mytest
Trigger tap after window reload
I have a form that's inside of a lightbox and I am trying to cache any user input to sessionStorage before an orientation change / window.location.reload occurs & then retrieve the sessionStorage key/value pairs & put them back into the form inputs afterwards. - 1) Caching any input - done - 2) If the form is in a lightbox & in mobile browser, then I need to trigger a tap on the a link: a[data-rel^="lightcase"] after the window reload - 3) Write the key/values to inputs - mostly written, but need
jQuery FadeIn / FadeOut inside a loop
I'm using a simple jQuery function to create a small image slider: $( ".grid-item" ).mouseover(function() { $(this).find(".slide-image").each(function(index) { $(this).delay(800*index).fadeIn(0); }); }).mouseleave(function() { console.log("Mouse Out!"); }); If the function plays once, it stops. Is there a way to loop the function? Check out my CodePen!
select an item from a list box & enable same type in other list box
Hi at first I am really sorry to put this much code. I am new to javascript. I have multiple list boxes, what I want is, when I select one or more iteams from 1st list box, all the related items in other list box should be enabled. please help me. <!DOCTYPE html> <html> <head> <title>Quotation</title> <style type="text/css"> .auto-style1 { text-align: center; } .auto-style3 { font-size: x-large; } .auto-style4 { text-align: left; } .auto-style5 { font-size: x-small; } .auto-style6 { font-size:
Trying to add functionality to hide multiple tables with hidden tbody
This code works but I'm having trouble figuring out how I can get this to work when multiple tables have hidden tbody. Right now, if there is at least 1 table with 1 row visible, then tables with hidden rows won't get hidden because the function isn't being applied to each table...Sunday at 7:00 for example. Fiddle: https://jsfiddle.net/qxexvjnn/
How to dynamically create option with Checkbox in html Select control?
Hi All, Fruits (Column Name) Apple Orange Mango I have a HTML select control. I am reading some data from database. Here for example I am reading Fruits which is having 3 value so it should create 3 Options with checkbox in Select Control.below is just example I want the same. When I select the any checkbox then it should show alert message which one is selected.for example in below pic if I select second checkbox then alert will be Second Checkbox selected. Please I want to create same but DYNAMICALLY.
How to sort a <ul> by the value of an input in every LI
Hello, i use a drag&drop-Plugin to sort lists. Now i would like to add a function to enter a numeric value, for very long lists, to place for example item 100 on third place. So i put an input in every LI, and try to sort the LIs by there values- actual code at the bottom. My problem is: how can i sort not by the "value" of the LI, but by the value of the input INSIDE the LI? jQuery(document).ready(function () { jQuery(".single_item input.sort_input").change(function () { alert ("WTF");
superfish menu on mobile
hi guys, i'm new on Joomla. I have a problem with superfish menu, i have set it and it work on desktop but on mobile it don't appear. menu isn't visible.. i don't see any possible set for mobile version and i don't know how resolve this problem.. i know that probably the solution is easy but help me please thanks so much christian
If NOT in array
Is this the right way to do IS NOT in array: $.inArray(tbodyNumber, ids) == -1 Since IS in array is: $.inArray(id, ids) != -1 id should be in ids, but tbodyNumber should not.
Toggle Play/Stop Button
How do I make this into one button that toggles play/stop? $('.play').click(function() { $('#jquery-video').get(0).play(); }); $('.stop').click(function() { $('#jquery-video').get(0).pause(); }); $('.toggle').click(function() {
if ($(this).hasClass('stopped')) {
console.log("stopped");
$(this).removeClass("stopped");
$(this).addClass("playing");
}
else {
console.log("playing");
$(this).removeClass("playing");
$(this).addClass("stopped");
}
});
</script>
Better way to replace a text pattern?
Assume on a web page there are text strings with the pattern "aaa bbb ccc" (without double quotes). I want to replace them by a blank or even with nothing (=empty string). Until now I used the following javascript commands to accomplish this: var content=document.body.innerHTML; newContent=content.replace(/aaa bbb ccc/g,' '); document.body.innerHTML=newContent; Is there a better way with jQuery to do this? Is there a way to restrict the replacement to only <ul>......</ul> elements resp. their inner
Needing help in making jquery newsticker responsive
Ohk here are my codes: http://codepen.io/anon/pen/aBErLR As you can see i already tried with : function checkPosition() { if (window.matchMedia('(min-width: 400px)').matches) { } else{ $(function () { $(".quotes") .each(function () { len = $(this) .text() .length; if (len > 15) { $(this) .text($(this) .text() .substr(0, 15) + '...')
Jquery version/responsive issue
Hi, Would the version of Jquery affect the way my site shows up on mobile devices? My programmer upgraded the Jquery to version 3.0 a while back, this has negatively affected the sliders on my site which we are working to fix right now. I also just recently noticed how messed up the site looks on my cell phone...if I get him to change it back to the original 1.10 (the sites frame work was created with this version) would that fix this issue? Thanks. My site: http://www.brightname.cn/
Form input values *sometimes* fail to be returned even though input names are posted correctly
I'm hitting a wall trying to debug something because I can't reproduce it and hoping that someone has encountered something similar and can point me in the right direction. Everything is in the context of a custom WordPress Plugin. I doubt that has anything to do with it, but just in case. I have a plain old text form that needs to be filled out that looks like this: <div class="extras" doc_id="57c3eec28a9c7"> <div class="row"> <div class="cell right"> <span class="extra_desc">Field
Next Page