how to select child of siblings?
Hello, My html is like this: <div class="container"> <div class="image"> <img src=""> </div> <div class="button"> <button>Button</button> </div> </div> <div class="container"> <div class="image"> <img src=""> </div> <div class="button"> <button>Button</button> </div> </div> how to select img when button is clicked? I tried this but doesent work: $('button').click(function(){ $(this).parent().siblings().find('img').css({
Place tables next to each other that are created w.r.t to position absolute
Hi, Plz find the fiddle http://jsfiddle.net/raving/3Lvth1dn/24/ I am creating multiple tables with number of columns and rows respectively. i have defined my css as div.innerdiv{ float: left; position:absolute; } , i know if i remove position:absolute or make position as relative will make the tables to place next to each other as desired. But i have a scenario where the position is forced to make as absolute and make the tables to place next to each other. I have an idea of placing the second
Ajax Post with JSON to PHP
This code works successfully without green-shaded codes. But if green codes are uncommented, nothing happens. Why???? [ json_encode.php ] require_once('connectvars.php'); //$wtype = $_POST['jenre']; $dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); $query1 = "SELECT eng, id_num FROM words Limit 10"; if ($result1=mysqli_query($dbc, $query1)){ $engrow = array(); while ($row1=mysqli_fetch_array($result1)) { $engrow[] = $row1; }//while
Dialog and Form problem
Hi. Have the next problem. Im open a Dialog with: <a href="bitacora.php" data-rel="dialog" >Show</a> Then this open a Dialog, and this dialog have a form. <?PHP header('Content-Type: text/html; charset=UTF-8'); include("modulos/variables.php"); if ($_SESSION['estado'] != "OK") header("Location: login.php"); include("sql/sql.php"); include("modulos/funciones.php"); //$norden=$_GET['norden']; //$ncedula=$_GET['ncedula']; Conectar(); ?> <!DOCTYPE html> <html> <head> <meta
Searching $(....contains(...)) function for ID + class names
Assume I have a HTML code similar to: <div> .... <span id="myid2151511" class="myclass23462362">....foobar....</span> .... </div> then I can search for the text string "foobar" and hide the innermost corresponding <div> element with the following jQuery code: $("div:contains('foobar')").eq(($("div:contains('foobar')").length) - 1).css("display", "none"); However this command does NOT work when I search for text patterns in id or class names. So the following does not work: $("div:contains('myid')").eq(($("div:contains('myid')").length)
Select First element every time in Searchable Datalist
I have searchable datalist (input with autocomplete), html as below <input type="text" id="city" name="city" list="clist" placeholder="Select City"> <datalist id="clist" name="clist"> <option value="10th mile">15094</option> <option value="A.s.peta">2958</option> <option value="Faizpur">7313</option> <option value="Gabbar">7480</option> <option value="Gadag">7227</option> <option value="Hadpid">6474</option> ......</datalist> As I press the keys in input textbox, it filters the datalist and displays
How to pass variable value .CS to Jquery
There are my code, I want y value catch from behind C# variable value. Please any one give me solution , Argent. <script type="text/javascript"> window.onload = function () { var chart = new CanvasJS.Chart("ChartID", { animationEnabled: true, title: { text: "Mark Entry Status Chart" }, data: [ { type: "column", //change type to bar, line, area, pie, etc dataPoints: [ { label: "Total Student ", y: 50}, { label: "Total Marks Entry", y: 29 } ] } ] }); chart.render(); } </script>
Can someone help me figure out how to write this jQuery
I am using jQuery to select a checkbox, highlight the row that the checkbox is in and then I want to update the value of a pick list field in that row. I am just learning... but it doesn't seem to be working all the way. Here is my code: $(document).ready(function () { $('.record_table tr').click(function (event) { if (event.target.type !== 'checkbox') { $(':checkbox', this).trigger('click'); } }); $("input[type='checkbox']").change(function (e) {
Weird behavior that I don't understand. Need advise.
Hi, I create dynamically a busy indicator so no real need for the entire code. I do show the indicator before doing a long running process for populating lists. The piece of code you see here is at the bottom of the function that creates the busy indicator and I'm calling the callback to say ok the busy is there so go on and do your long running process but instead of seeing the indicator before the long running process, the process runs before and then I see the indicator after the process is
mouse event: drag?
Hi all, In the official documentation of jquery I looked at the mouse events which jquery supports. (http://docs.jquery.com/Events) I was a little dissapointed to find nothing more than the usual down, move, out, over and up, as I was looking for something like drag. Is there a way to trigger something on a mousedrag event with jquery? If not with jquery can it be done at all? Thanks in advance for your replies
how to copy the selected textbox data and copied to into textarea boxes.
Hi This is deepthi i have one textbox field ,beside one button is there and below one textarea box is there. when we enter the text in textboxfield it has to select the text and after that when we click on ctrl+v button it has to copied into text area field. this is our requirement. any one help me.
How to calculate the td's of only first row in the table
Plz find my table below. <table class="tileTable"> <tr> <td></td> </tr> </table <table class="tileTable"> <tr> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> </table> <table class="tileTable"> <tr> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> </tr> </table> I am trying to read all the td's that are present in the first row
How to prompt the user to save a generated file locally?
Provided that you Know the name and location of the file on the server, how is it possible to prompt the user to save said file on their desktop, whether it be to their downloads folder or elsewhere? My scenario is a PDF file is generated on the server (C#). The file is saved to a folder there on the server. But the user needs to be able to save that file to their desktop. Is this possible? If so, what event can I use for this? The user will click a "Generate PDF" button on the web page/form, and
jqeury ajax not returning false
I am new here. My program bellow checks if employee id exists using jquery ajax. I want it to return false if the employee id already exists but its not returning false. $.post("connect_ajax_php.php", {type: "checkId", val: val, field: "emp_id", table: "employee"}) .done(function(data, succ){ data = $.trim(data); if( succ =="success" && data=="true" ){ $( errContId ).html( val+" already exist" ); $( id ).css( {"border":"1px solid red"} ); return false; }else{ $( errContId ).html(""); $( id ).css(
jQuery get attr
Hi. I am trying to get attr 'data-id of specific button since few hours and I can not manage to do it. please help <div class="row" id="answersRow"> <div class="col-xs-12" id="answers"> <button data-id="{{answer.id}}" ng-repeat = "answer in post.answers track by $index" class="btn btn-success answer" ng-click="addVote()">{{answer.text}}</button> </div> </div>My approach: $('.answer').click(function(){ $(this).attr('data-id'); })
How to access dynamically created list elements, <li>
I have created a list elements <li> dynamically. I want a jQuery function to be called when it is clicked. How do i do that? Like i have integrated link <a href> within that <li> tag.
how do I turn asynchronous to be false in my jquery ajax
Please how do I turn asynchronous to be false as async: false in my code bellow: $.post("connect_ajax_php.php", {type: "checkId", val: val, field: "emp_id", table: "employee"}) .done(function(data, succ){ data = $.trim(data); if( succ =="success" && data=="true" ){ $( errContId ).html( val+" already exist" ); $( id ).css( {"border":"1px solid red"} ); return false; }else{ $( errContId ).html(""); $( id ).css( {"border":"1px solid #ccc"} ); } });
Accordion
Hello, at my Website www.jvp-gmbh.de/Test/ you can find at 'Impressum' an "Accordion". Instruction:http://jqueryui.com/accordion/#hoverintent Why always the Navigationsbar disappear?
Carousel stop at end
All Right. I am building a simple carousel with simple jQuery/cs3 and it is working fine so far. However when I continue clicking next slide, the slider will become out of focus as you can see in this fiddle: Fiddle . I need something that will stop the carousel when it is at it's end (no matter if the size of window as been changed). For at note, the slider is responsive, and will snap to specified grids. I have tried testing with something like: if (counter + 1 == $('.carousel > div > article').length)
I want to develop Locket Photo Frames using jquery and html5
Hi, I am developing a mobile application and i want to develop locket photo frame. Locket Photo Frames please help me
jQuery for print?
I have a website which takes some weight from the user's shoulders by fitting text in containers, changing the layout depending on the amount, etc. Some functions react to window sizes and viewport size. How do I make sure they run for the printer's media size? And then, how do I stop some of those functions from running for the printed version?
animation issue
Hi, I am trying to write a function that will animate/fade images one after the other. The function will accept an array, variable length, containing images links to animate. My question is how to implement animation for unknown number of images ? Thanks,
How to send email in jQuery?
Hi all, how can I send an e-mail using jQuery? I need some step-by-step tutorial or it would be absolutely the best some example what reaaly works, thanks. a lot.
How to read the appSettings from webconfig file
Hi, In the below function I want to read the config file appSettings in place of url key, currently I am hard coding it (url: "http://localhost:8000//API/Application/Refresh") How can i achieve this? function refresh() { document.getElementById("div-content-wrapper").innerHTML = ""; document.getElementById("page-content-wrapper").innerHTML = ""; $.ajax({ type: "GET", url: "http://localhost:8000//API/Application/Refresh", dataType: "text", crossDomain: true,
How to secure JS Applications with Jquery or Angular JS
I developed a Complete SPA application with jquery with ajax like asana. In this app, including some features like, Listing Users, When clicking a user loading his tasks, When clicking a specific task loading the task details . etc... I completed all the development parts with jquery, But When a user clicking a task from my app, I collecting the task id from an html element attribute and sent to ajax php page. We can change the attribute value with firebug easily. After that clicking the task name
live and load function
I hope somebody can help me. I want to load a new page into a <section id="content"></section> but when this page is a certain name.html I also want to load a navigation.html in a <div id="sidebar"></div> I want to use live because I have some css settings for the #sidebar. I tried this: $(ul li a).on('click', function(e){ e.preventDefault(); var url=$(this).attr('href'); if (url="name.html"){ $('#content').load(url); $('#sidebar')live('load', 'includes/sidebar1.html');
check button is enable or disable using jquery
var disabled = $("#buttonNew").is(":disabled"); i am tried to check the button is enabled or disabled using above code but above code returns always false . Code for disable the button: $('[id$=buttonNew]').attr('disabled', 'disabled'); Code for enable the button $('[id$=buttonDelete]').removeAttr('disabled');
how to make a updatable event calender ?
Hey guys , i am just building a simple html website and basically the guy i am building this site for now wants a event calender to be added to the site . - Add new events and also - View existing events that are present. Something very similar or exactly like this . I have no idea what to use here , i know jQuery UI may have a similar widget , but than can i add and view events. also i guess i will need somekind of a backend right ? Thank you.
How to create an animation in jQuery?
Hi all, is it possible to create animation in jQuery? I mean not just like a text animation or css-width animation, but I mean moving object or something like this ... http://creativecruise.nl/ ...
how would you write a independant JS library(no jquery), that u could just use to check if the document is ready
hey guys , i got a bit of a twisted question , i always wonder how exactly does $(function(){ }); work similar to $(document).ready(function(){ }); i looked at the source and i see the below code :: else if (jQuery.isFunction(selector)) { return typeof rootjQuery.ready !== "undefined" ? rootjQuery.ready(selector) : // Execute immediately if ready is not present selector(jQuery); } which is somewhat difficult to understand how does $(function(){}) work behind the scenes.
Slide Toggle 2 individual divs from two different buttons
Hi, I have two divs which I want to slidetoggle individually. So when I click on button one, it slidetoggles just the green box. When I click on button two, it slidetoggles just the yellow box. At any one point I only want to see one box. I've put a jsfiddle here: http://jsfiddle.net/wileyscouser/esonow8r/18/
Having an issue with t.replace dont know the cause
Every time I include jquery like so: <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script> This error shows up: t.replace is not a function This only happens when I navigate from the 'diensten' to the homepage. This shows by causing the page to transition EXTREMELY slow. But If I load the 'diensten' page directly, all is good. I have no clue how this can be. It would help me a great deal if someone could explain. Please navigate here to see a link to my website.
SVG Editing plugin or library
I have a need for a simple SVG editor or "editor framework" that we can use in a native mobile touchscreen app that uses Rhodes (Rails-like server in the app programmed in Ruby, WebView UI using jQuery Mobile). We currently use a simple native signature-capture extension, that only allows very simple bitmap drawing with no edit. That extension is no longer available to us in the latest Rhodes, and anyway it's a bit too basic for our needs. So, we've temporarily replaced it with sketch.js: http://intridea.github.io/sketch.js/
remove an id after an animation in jquery
I'd like to remove an id from an image after its animation is completed. I have this in my code: if(index == 1 && direction =='down'){ $('#slidetext1 #rock').animate({right:"0"}); $('#slidetext1 #deer').animate({left: "0"}).addClass('open').removeAttr('id'); } It's not working because it removes the id before even starting the animation, but what I want to do is to remove the id #deer from the image and add ('open') after the .animate() has been executed. so here i made a jsfiddle: http://jsfiddle.net/67oe1jvn/45/
Windows.location
I'm having trouble getting the condition to work correctly and load the correct page. No pages are loading and no error is given <script> $(document).ready(function() { $("#app_type").submit(function() { var selrange = $("select#range").val(); var selplace = $("select#place").val(); var selindustry = $("select#industry").val(); if (selrange == '1') { if (selplace == "1") { window.location = "application_us_short.php"; }
Assign a css property to each div while iterating through loop
Hi , I have a loop below where i am trying to iterate over couple of tables and trying to assign the css values individually for each table, but when i do this i am ending up with the last value that is assigned for the last table. How can i assign individual values for each table $('.iptableNew').each(function () { var leftCalNew = lPostion * 40; var topCalNew = Tposition * 40; $('.iptableNew').css({ 'position': 'absolute', 'top': topCalNew, 'left': leftCalNew });
No event is generated on dynamically generated DOM elements
Hi, I am generating various DOM elements using ajax and inserting into a div with Dynamically generated element <button class="mybtn" id="1">Btn1</button> <button class="mybtn" id="2">Btn2</button> Div into which I am inserting the elements <div class="col-md-12" id="displayslots"> </div> When i use this below code no click event gets fired :( , please help $(document).ready(function() { $(". mybtn ").on("click", function(){ var id=$(this).attr('id'); alert(id); }); }); Thanks for help in advance
Anyone see why this code might not work?
this code works: $('#offer span').click(function(){ var $divx = $('#offerbody').first(); $(this).html( $divx.is(':visible') ? ' [+] ' : ' [–] '); $divx.slideToggle(); }); this code does nothing (I was hoping it would make the div hidden): $(document).ready(function () { var $divx = $('#offerbody').first(); $divx.css('visibility','hidden'); $(this).html( $divx.is(':visible') ? ' [+] ' : ' [–] '); });
Why is this event handler not working?
I'm trying to write a script that creates a grid of squares based on user input and then has those squares change colour on mouseover, like some kind of really low res Etch-A-Sketch. Everything is working properly except for the colour changing part. Here's my code (the class 'written' just changes an element's background colour to black): var newLine = "<div class='line'></div>"; var newTile = "<div class='tile'></div>"; var createLine = function(n) { $('#container').append(newLine);
recording an animation to a video
Hi, is it possible to save/record a jquery animation to mp4 or avi video ?
Next Page