slideToggle sliding margin after intended div
Hi, I'm trying to slideToggle a div according to the code posted below. What happens is that the div I want to slide up and down actually jumps and the margin after the div slides. Am I thinking too complicated? Thanks for your help... $(document).ready(function () { $(".button").click(function () { $(this).parent().next("div").slideToggle(); }); }); <div class="section"> <div class="bar"> <a class="button">Users <span class="arrow">▼</span></a>
JQuery Checkbox Filter Issues
I am trying to make this work with already existing javascripts on my webpage. This is what I want http://jsfiddle.net/tkLK6/ But when adding it to my already existing javascript I cannot get it to "filter". (See this JSFiddle) Thanks for your help!
ID starts with matches more than intended
I've been dealing with this problem and need help to match exactly what I intend for. I'm learning jquery and cannot get it right :( I'm making dynamic textboxes and give an id in this format: id = "addBox" + row + "_" + num; row and num are variables passed by the function. row is dynamic so can go from 1 to 20. Per every row I can have multiple textbooxes and that's the reason for num. When I want to select how many nums are in that row I put a variable counter to give me that value
Pass variable between pages
Hello everyone, I've tried to solve this problem for quite a while without success, so it would be awesome if someone could help me. I want to create a webapp with a tag cloud as navigation tool. No problem there, but if someone clicks on a tag in the cloud he should get images related to the tag. So I need to pass the information which tag was clicked to show the right images. Its works just fine to pass this information between pages using multiple .html documents. Then I can write the tag in the
Can someone tell me in what cases is necessary or useful caching an ajax call (cache: true) ? or when not? Could you give a practical example?
Can someone tell me in what cases is necessary or useful caching an ajax call (cache: true ) ? or when not? Could you give a practical example?
code explanation
Take a look at this code here at lines 12-13: The variables el and group have the jquery symbol in front of them...but in a way I cannot understand. The jquery symbol is always followed by a dot. Can someone explain it to me please? Does this has anything to do with the function found in line 90?
Remove width/height attributes from Image
I use the following code to load image $(img).load(function () { $(img).addClass("itmImgClass"); }).attr("src", itemData.begedurl); How can I remove the width and height attributes from the resulting image markup ?
Hide all element's that doesn't have the Class
Hi, I've been a bit stuck, can anybody help me please. I want a simple operation, get the class of the clicked item and hide all elements inside of .rs-tabs that doesn't have the class of the clicked element and show the one witch has the same class. Here's the codepen I'm working on. http://codepen.io/anon/pen/JorpaM Any help is appreciated, Best wishes,
Select on the hashTable
I am a newbie in jquery. I have two hashtable like this: Compagnies = {id="value", name="value",....} and Campaigns = {id_company="value", title="value"....}. I am able to do an select box to list all compagnies. But when i select an company i want to see all his compaigns on another select box Thank you
jQuery one pagescrolling
Hi all ... I have created a menu. When I click on it it scroll down to see the specific div ... but how to stop on accurate place ... for example at the top line of the div .. or 20px under this line ... u know what I mean? I hope yes ... please help me ... thanks a lot ... I download something but I am not sure if it is whole code <script> if ( ! window.console ) console = { log: function(){} }; // The actual plugin $('.single-page-nav').singlePageNav({
Action to json stops jquery action
I am pulling locations from a datatable via microsoft sql. The script is below. It work fine on my development machine. When I move it to the webserver it stop executing at: var markers = JSON.parse('<%=GetLocations()%>'); <script type="text/javascript"> function initialize() { var mapOptions = { center: new google.maps.LatLng(44.87431, -93.17217), zoom: 10, myTypeId: google.maps.MapTypeId.ROADMAP }; var infoWindow = new
Scroll down list of products and a shopping cart: update the cart but keeping the vertical position of the products list when going back
I have a list of products and a shopping cart that I create by myself using PHP, jQuery.. The shopping cart is always shown on the right margin of the list. After adding some products, I go to the standalone product page and remove a product. If I go back to the list of products, the shopping cart still shows the removed product.I know I could fix this not caching the web page of the product's list, BUT the products list is populated using a ajax calls, so when going back to the products list it
data attribute return null
Hi, I have already asked a question that my code is working locally in my machine, but when checked in, all the data attributes disappear, I started duplicating my code in a jsfiddle : http://jsfiddle.net/mlotfi/x9xhw3v3/ I don't know why I got : null null Thanks, your help is appreciated.
How do I attach multiple functions with jQuery Ajax content?
I've got a bunch of functions defined in an external js file like so: function tabs() { $(".tabs").tabs(); } function closeOverlay() { $(document).on('click','.close',function(event) { $(".overlay").fadeOut(); }); } I'm using ajax to load content into my template, and need to load these functions along with it. This loads my content and my tabs function just fine: $(document).on('click','#invite',function(event) { $(".overlay").fadeIn(); $(".overlay").load("inc/invite-guests.htm",tabs); }); But I
Scroll event seems to be deactivated
Hello to all on my dev website (not in production), the scroll event of jQuery seems to be deactivated. Example pages : www.cybevasion.info/gites-la-maison-du-bonheur-colmar-e30405.html on this one, the map should be loaded when scrolling to bottom of the page and it should scroll to bottom when clicking on the blue button on top right cornet www.cybevasion.info/gites-colmar-v29711.html on this one, the map on the right should be sticked at the bottom of the viewport when scroll All plugins and my
Having AJAX change result based on PHP If statement outcome?
Hi guys, I have had my fair share of experience with jQuery but have never dared go near the AJAX uses just because of the effect it has on my brain and causes me to become obsessive with fixing errors. So, here I am with an error... I have my usersystem.js and here is the login section which deals with the result of the user attempting to login. }); $("#logincontent").on('click', '#login', function(){ var loginusername = $("#loginusername").val(); var loginpassword = $("#loginpassword").val(); var
anchor tag die and live events are not working in Jquery 1.11 with migrate plugin
Hi, I am defining <a> in the following way. <a title="New User" role="button" id="newUser" href="#"><img src="/images/newUser.gif" alt="New User" class="Icon_NewUser"></a> In my js file I have implemented click event like bellow $jq("#newUser").die("click").live("click",function(e){ //my logic }); This code is working fine in Jquery1.7. Now I moved Jquery1.7 to jquer1.11 with jquery migrate plugin. After migration click event is working first time only. When I clicked second time the event is
Slidetoggle closed by default
Hi All, I am using the following code to toggle a section. I want to make section1 as closed by default. I am not sure about the syntax. <script> $(document).ready(function(){ $("#Important").click(function(){ $("#section1").slideToggle(400); }); }); </script> Any help would be appreciated
Using Jquery code in PROD
Hi Team, Just wanted to check if the following files/paths are safe to use for production environment. <link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script> I am not very familiar with how Jquery works so just wanted to use the above code. Any help would be appreciated. Regards, Akash
Stuck in banners animation
Hello I'm stuck with a simple script. Would you please help me? It's just working once.... :( THANKS! jQuery(document).ready(function () { $('.banner-right .visible').fadeIn(400); function timeout_trigger() { $('.banner-right img.visible').fadeOut(400,function(){ $('.banner-right img:not(.visible)').fadeIn(400, function(){ $('.banner-right img.visible').removeClass('visible').siblings('.banner-right img').addClass('visible'); }); }); } setTimeout(timeout_trigger,3000); });
Apply function to an initially hidden element
I'm trying to do something that should be very simple here-slide/toggle the menu items in the MOBILE menu. This mobile menu is initially hidden on a wide screen upon load. On resize (making the screen smaller), the Hamburger pops in and when it's clicked, the mobile menu appears. That's fine. I'm trying to slide toggle the submenu items. BUT ... I can't even get the mobile menu to respond to the function to show text in the console log. I thought I could use the on function to attach functions
How to add space before each string in list of strings?
Hey, I have a problem, not sure if this is the right place for this, but maybe someone knows. So I have a variable like this: var listofthings=[{ 'y': 43, 'x': 32, 'name': ['E-GEOD-6280','E-MEXP-167','E-MEXP-167','E-MEXP-167'], 'fillColor': 'rgba(0,0,255,0.3)' }, { 'y': 653, 'x': 1196, 'name': ['E-MEXP-167'], 'fillColor': 'rgba(0,0,255,0.3)' }, { 'y': 152, 'x': 324, 'name': ['E-GEOD-23058','E-MEXP-167','E-MEXP-167'],
Modal box when submitting the form
I want to show modal box confirmation before submitting the form. how can I do that? I have a code like below, which will get data in input and will check in database, if data is already exist. but how can I have a confirmation modal when condition is false and form is ready to submit? $(function(){ $('#my-submit-button').on('click', function(){ $.post("http://domain.com.ph/portal/reports/home_members/ajax_chassis_no/", $('#my-form').serialize(), function(result){
Update function.
Hi everybody, I need your help to solve a problem : when I run a page of my site , the system automatically performs a js function that I should not . This function is used to update student grades : when the teacher types the student grades , the function updates the db . I do not want this function is automatically executed when the page loads . this is the js function: function cambiaProposta(arg1, arg2, arg3, arg4, arg5, arg6, event) { var request; request = new XMLHttpRequest();
jQuery duplicated prepended div when page refreshed??
$(function(){ $("#Form > form").submit(function(event){ event.preventDefault(); if($.trim($("textarea").val()).length!=0) { $.post("submit.php",{"text":$("textarea").val(),"page":"<?php echo $_GET['page']; ?>"},function(data){ $(data).hide().prependTo(".Display").slideDown("slow"); $("#Form > form")[0].reset(); }); } }); }); Basically what I do is send data entered
Select one element only on .hover() function among other elements with same class
Hi all, I'm very new to code and doing some practice on jQuery. I'm trying to use jQuery (aware that @media query would be probably easier as CSS only solution) to have background images fade in and out on on selected words of a text with a .hover() event. As all the images have the same CSS properties, they share the same class, and (obviously) jQuery doesn't make the distinction of which specific one to fade in/out, if not instructed to do so. Which is what I am struggling with. Here the basic
html data attribute stripped from my code in Apache
I am developing locally in my windows using Netbeans IDE and tomcat, data attributes work fine in my local tomcat, but when I checked in my code in the Apache server, and took a look in source code, I found out that all data attributes are stripped from the code : when I run my code locally (tomcat) : http://jsfiddle.net/mlotfi/b2y9Ls5o/ when I run it in Apache : http://jsfiddle.net/mlotfi/az68hkb0/ Thanks, your help is appreciated.
Get input empty value
In first: In version 1.9 we can do that and have the right result: $('input[value=]'), now need be $('input[value=""]'); OK, but now don`t work, if we have 2 inputs and fill one, the selector bring both, and not just empty. Do we have another method to take just empty inputs? Tks a lot.
content dynamic banner
Hi all, how can I create content dynamic banner? Like we have three div boxes filled with text, I see at first first div box and with some animation it change to second, third, first ,... thanks
Im trying to assign json data to each div separately i.e. 5 divs using one div structure.
HTML :- <div class="normal_add_item_box left" id="normal_add_item_box"> <div class="nm_image_area" id="nm_image_area"><img src="images/default.png"> <div class="edit_box" id="edit_box"> <div class="ed_del_icons" id="ed_del_icons"> <i class="icon-pencil hover_icons" id="nm_edit"></i> <i class="icon-trash hover_icons" id="nm_delete"></i> </div> <!-- Close Edit Delete Icons --> </div> </div> <!-- close normal image area box --> <div class="veg_nv" id="veg_nv"><div></div></div> <div class="nm_name_area"
'SyntaxError' in IE10
So, we have some code that worked in IE9, and is now causing problems in IE10. I'm getting this error: SCRIPT5022: SyntaxError jquery-1.7.js, line 554 character 3 On this line: $(document).on("successEventInit", populate); I'm running in Browser Mode: IE10 and Document Mode: Standards. Is there a problem or special catch with using jQuery 1.7 in IE10? Thanks.
JSONP Cross Domain Error
With some help from people in IRC chat and this forum, about two years ago I wrote some code to take data from an HTTPS site and then return it to my HTTP site. Well long story short, IE sucks and has issues in version 8 & 9 with my code. I will let you know that I do not know javascript or jquery that well. I'm sorry if my code is horrible looking. <script type="text/javascript"> $(".div1").empty(); // Make sure my div is clear. My cms will not allow me to have an empty item so I had to
JQuery not working without alert()
Dear all, I am updating a SharePoint webpage. The page belong to search center. So there is a google-like textbox in the middle of page. My script is try to get the querystring and fill in the textbox. Here is the code: $(function() { var keyword = getParameterByName('k'); alert(keyword); $("#SearchBox input:text").eq(0).val(keyword); }); function getParameterByName(name) { name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
Cloning and assigning dynamic element IDs
Hi Guys, Well this is my first post, I have been using jQuery here and there for a few small enhancements, I have to say I really like it so far, but it seems I have run into a little snag. If you look at the code below it should make some sense, hopefully. <!doctype html> <html> <head> <meta charset="utf-8"> <title>MiSland MX</title> <style> .ninja { visibility: hidden; background: green; } </style> </head> <body> <script src="jquery-2.1.0.js"></script> <script> var c = 0; $(
Setting text on drop down list by his value.
Hi to everybody, I need your help because I have problem to set a text on drop down list giving his value. This is my select: <select id ="quadri"> <option value='1'>I° Quadrimestre</option> <option value='3'>II° Quadrimestre </option> </select> When I select the 2nd option I refresh the page and I would like to refresh my select as well. Thanks in advance. Tegatti
conditionally position a footer in the bottom of the window
i have 3 divs header content footer the content hieght is dynamic (can be expanded and collapsed by the user at run time) if the sum of the height of the 3 divs is bigger the the window's height every thing is fine but when it is smaller (the user reduced the size of the content div) the footer is positioned right after the content and there is a white space underneath the footer. in such a case I want the footer to be at the bottom of the window each time the content is collapse or expanded i call
Parsing a CSV, return specific row as array
Hello all, I'm having a bit of trouble finding out how to do this with google so I figured I would give this a shot. What I'm looking to do is have a textbox on my webpage where someone can type in their phone number (restricted to numerical values only), which then will search a csv file for the row that starts with their phone number and return all of the separated values in that row. For example in c# it would look something like this: lets say my csv file, openorders.csv contains 3 columns
Jquery accordion will not close after expanded.
Hello, I hope to get some support here since I am unable to get it on a Wordpress Plugin Support page. We are using a plugin on Wordpress to get an accordion feature and it is using jQuery. The problem is, after expanding an element, it will not close back. It acts like it will close but then comes right back open. Here is the current code: /* Accordion */ jQuery('.simnor-shortcode-toggle-active').each(function() { jQuery(this).find('.simnor-shortcode-toggle-content').show();
Everything inside jQuery.ajax({ success:
Hi, First of all , I apologize - my English is bad . Is it a bad approach to put all the main code inside success setting ($.ajax({ success: ) - for example, I have this JSON in file mydata.json: [ {"name":"Aster","product":"aster","stock":"10","price":"2.99"}, {"name":"Daffodil","product":"daffodil","stock":"10","price":"1.99"}, {"name":"Rose","product":"rose","stock":"2","price":"4.99"}, {"name":"Peony","product":"peony","stock":"3","price":"1.50"}, {"name":"Primula","product":"primula","stock":"20","price":"3.12"},
Processing a form without reloading the page
Hi I'm sorry for asking such a stupid question, but I have searched and tried various things with no luck. I am trying to use a form to calculate a value based on three parameters and display a circle on a Google map. I have a small form with three fields in a <div> where the user can enter the desired values. Once he presses submit, I want to use those values, calculate the size and create the marker. Somehow when I press submit, the same page gets reloaded but obviously the marker is not created.
Next Page