create a loop for jquery TABs in different DIVs
The code below I am going to use for more thank one tabs (to have something like tabs[i]) and I think would be better to have a loop: <script> $(document).ready(function() { $('.nav-tabs1 > li > a').click(function(event){ event.preventDefault();//stop browser to take action for clicked anchor var active_tab_selector = $('.nav-tabs1 > li.active > a').attr('href'); //get displaying tab content jQuery selector var actived_nav = $('.nav-tabs1 > li.active'); //find actived navigation and remove 'active'
Comparing scrollTop and scrollHeight?
I want to compare the scrollTop of my overflow:auto div to scrollHeight so I can append new data when I scroll to the bottom. However, scrollTop, when I scroll to the bottom, outputs a much lesser value than how scrollHeight does... Any ideas? Thanks!
jQuery process bar or clock for long runing server jobs and keep browser from timing out?
I need a way using jQuery to show process bar or clock for long runing job on server and keep browser from timing out? Does anyone have a solution using jQuery in a php program. Thanks James James R. Martin J. Martin Associates
need a Professional help?
i use Nosql database i had a table call aabc i had a field name rows the values on the field is array but the number on the values 0,1,2,3 .... the database program who is give it not on the same data i want make login code by jquery really need a loop i'll have two textbox one for username like txtuser and other for txtpsw and like the last pic , test1 work with password who it belongs to him user:test1, password:1111 as up if he login the <div> will appear.
Difference between appending to a jquery-wrapped object and appending using an ID selector
Hi there, I'm using jquery-1.10.1 and relatively new to web frontend development. My question is as follows: is there a difference between wrapping a div element in a jquery object then appending to that object, and directly appending to the div using the selector $('#div_id').append() ? I have a jquery widget that behaves differently depending on whether I'm passing around a div wrapped in a jquery object, or appending to div via selector. In the first instance I have this: div.append(content);
Glitch/odd behavior with Z-Index and JQuery in Safari
Hi! This is my first post on this forum, so if I do something wrong feel free to let me know :) I originally created this question on stack overflow, foolishly in the mid-afternoon on sunday, so there has been very few views. I'm reposting an (edited version) of it here, to see if I have more luck here. I've created an advertisement panel at the very top of my webpage. This can be expanded or collapsed. When the expand/collapse bar reaches the navigation bar, they merge and become fixed. In safari,
Problem with getting visual to work
Ok at first, I am new to this so bear with me. I have this page that displays data in a simple list. Nothing strange really. On each row there is an edit button to which when you click on it triggers a javascript that turns all the fields that are to be able to be edited on that row to edit mode: $(x).children(':lt(8)').each(function (i, e) { if (i == 2) { // The selection of authentication var html = $('<select>' + authlevelList.map(function (e) { return '<option
Problem with tool tip
Hi Geniuses! I have problems with "tool tip". Project: http://codepen.io/anon/pen/KzDjB Function: $(function() { $( document ).tooltip({ position: { my: "center bottom-20", at: "center top", using: function( position, feedback ) { $( this ).css( position ); $( "<div>" ) .addClass( "arrow" ) .addClass( feedback.vertical ) .addClass( feedback.horizontal ) .appendTo( this ); } }
How to get value from drop down select box
I am trying to get the value of a selected option in a drop down box with jquery. The problem is, I have one after another selection boxes. When the user selects the first one, it shows the second, when selected the second the user chooses the third. When the third appears, lets say that the user changed his mind about the first one. How can I make it reappear the second one, dissapearing the third and getting the first one new value (getting values in php)? Please help with a very simple example!
ajax php server side code
I read jQuery document regarding ajax. It says that I need pass a server side php file to ajax. If this is the case then I need one php file for one ajax function. Is it possible to pass a php file and function to ajax then I have have a couple functions in the same php file. like the following example, $.ajax( "example.php?Method=Myfunction"&MyParam) or I have to use $.ajax("example.php") Your information and help is great appreciated, regards, iccsi,
How can I show my jquery alert from within a child view?
Hi, I have a javascript inside a partial view that sits in a parent view. There is a submit button on the partial view that when clicked I would like to fire an alert. <script type="text/javascript"> $(function () { var selectedName = $("#selectaname"); $("#sendMail").click(function () { if (selectedName.val() == "someValue") { alert("You need to select the correct name"); return false; } });
Bind image button click
I have an image button and i am trying to bind click event to a function. I have tried binding it using its id: $("#imgBtn").click(function () { alert('Img btn clicked'); }); and $("#imgBtn").live('click',function () { alert('Img btn clicked'); }); and $(document).ready(function () { $("#imgBtn").click(function () { alert('Img btn clicked'); }); But am not able to achieve this.
how can i shorten the following ?
how can i shorten the following $( "#dialog" ).dialog({ autoOpen: false }); $( "#opener" ).click(function() { $( "#dialog" ).dialog( "open" ); }); $( "#dialog" ).dialog( "option", "width", 500 ); $( "#dialog" ).dialog( "option", "height", 400 ); $( "#dialog2" ).dialog({ autoOpen: false }); $( "#opener2" ).click(function() { $( "#dialog2" ).dialog( "open" ); }); $( "#dialog2" ).dialog( "option", "width", 500 ); $( "#dialog2" ).dialog( "option", "height", 400 ); $( "#dialog3" ).dialog({ autoOpen:
JQUERY performance impact on PLT
Does anyone have data on JQUERY's impact on PLT? Specifically around library load times. How many miliseconds does it take to load?
Jquery Slider Problem
I cannot get my jquery flexislider to show up. What is wrong with my code? My site
Issue on Adding Class to Element which already Had same Class
I am trying to add an animation class to on div by using at This Demo following code and repeating the result on each time click as: $(document).ready(function(){ $("#1").on("click",function(){ $('#layer1').addClass('animated fadeInLeft'); // $('#layer1').removeClass('animated fadeInLeft'); }); $("#2").on("click",function(){ $('#layer1').addClass('animated fadeInLeft'); }); });but it it seems the process is happeining only one time and I am not able to add the classes animated
Elements alignment in form
Hello Guys, I am beginner, so please bear with me!! The question is on form element. I am creating a form which contains input fields and select menus. But the elements are not in a proper alignment. Example, input fields are coming in a proper alignment, where as the select menus are in a different alignment. I want the all the text input boxes along with select menus come in the same alignment. Please find the code below. <form method="post" action="demoform.asp"> <div class="ui-field-contain">
setInterval problem
Hello all, I am still new at jQuery so here is a thing that didn't get. Why am I getting different results when the time out is more than a second, try 60 seconds (60000) and above ?? It wouldn't stop / clear the fading function right away. what is the logic or the behavier of setInterval function() ??? I am confused with this bug all day. Here is the sample code : <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0"
ReG:Error: Syntax error, unrecognized expression: http://some.serve.com/image-tn.png
Hi ya, I am using jquery 1.10.2 minified version (which is coming from struts jquery plugin) recently we have upgraded from lower version to jquery 1.10.2 we noticed some weird behaviour of image tags . I am using an ajax call to retrieve image urls (these were hosted on a hosting server) and dynamically adding to the page . $.ajax({ type: "GET", url: "retrieveImages.action", data: "design.id="+$('#designTemplateVersionId').val(),
HTML content returned from jQuery.ajax not parsing as HTML
I'm using a coldfusion cfsavecontent tag in a cfc to generate a block of html. This cfc is called from jQuery.ajax. The success block is this function: ,success: function(response) { jQuery("#divDataDisplay").html(response); [other unrelated code here] } The content that displays on the page due to the success block includes html tags as plain text - not rendered as html. The closest closed ticket I found was http://forum.jquery.com/topic/display-the-result-of-jquery-ajax-call-as-html-string-and-not-plain-string
Object doesn't support property or method 'jstree'
Hi, I'm new to jquery and I'm been trying to learn by jumping head first into a few simple projects that I need for work. I'm working on a simple MVC project where I would like to present a file system and some files to the end user. It's pretty simple concept. So using NuGet I downloaded and installed jquery 1.9.1 and jstree 3.0. I created a simple page and controller and added the reference to both jquery and jstree, created a simple ready method on a div object, and when it hits that line it
Hover Function Not Working On Rapael.js Objects From an Array
Using Raphael.js 2.1.0 I am trying to create circle objects on the Canvas from an array of coordinates by using this code: var map = Raphael('canvas', 500, 500); var coords = [ [150,50], [20,85], [350,95] ]; var circle; for(var i = 0; i < coords.length; i++){ circle = map.circle(coords[i][0], coords[i][1], 20); circle.toFront(); circle.attr({ fill: '#98ED00', translation: "4,4", stroke: '#FFF', 'stroke-width': 4, opacity: 1, }); } circle.hover( function ()
Combine results from two separate REST Calls
Hi all, I am using $.ajax to output REST data that is similar in structure across two data sources. I will be placing the data in a table. I was thinking of just appending the data from the 1st then the 2nd source. Is there any value to merge these, and if so, how would I do it? Thanks! Kelly
Help with animating a child element
Hi all I have the following HTML of links: <ul class="maingrid"> <li><aside class="slidebox left">Test One</aside><img src="/images/image.jpg"></li> <li><aside class="slidebox right">Test Two</aside><img src="/images/image.jpg"></li> <li><aside class="slidebox top">Test Three</aside><img src="/images/image.jpg"></li> <li><aside class="slidebox bottom">Test Four</aside><img src="/images/image.jpg"></li> <li><aside class="slidebox right">Test Five</aside><img src="/images/image.jpg"></li>
Deferred execution order
When creating a new Deferred object, if I attach handlers in the following order: var x = $.Deferred(); x.done(function () { console.log('done 1'); }); x.always(function () { console.log('always 1'); }); x.done(function () { console.log('done 2'); }); x.always(function () { console.log('always 2'); }); x.resolve(); I get the following output: done 1 always 1 done 2 always 2 Is this a bug? Why don't all of the 'done' functions fire before the 'always' functions? Why are they intermingled? Thanks!
select and desappear
Hello every body i am the newbie in java script I want to do this homework: cinema's reservation I have a page like this: page_1.html [CODE] <!DOCTYPE html> <html> <body> <h2>how many tickets do you want? </h2> <form action = "page_2.html"> <select> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <input type="submit"> </form> </select> </body> </html> [/CODE] page_2.html [CODE] <!DOCTYPE
Related Info + Cascading Dropdowns
Hi we started having problems with the jQuery since this morning. The SharePoint 2010' forms that had being using JS and JQuery stopped working… Any thoughts? Thanks
Simulate Hover on Mobile Device
Hi folks, I am using jQuery for my drop down menus on a website. When the mouse hovers over an ul the li items appear and drop down. Everything works fine. However when I view the site on a mobile device then a problem arises. there is no hover event. Below is the jQuery code I am using: <script type="text/javascript"> $(document).ready(function(){ $("#nav-one li").hover( function(){ $("ul", this).fadeIn(800); }, function() { } ); if (document.all) { $("#nav-one li").hoverClass ("sfHover");
Syntax error in code with 1.11.1 update, worked with 1.10.2
So as of version1.11.1 this string of code no longer works and throws an error. This is the error - Error: Syntax error, unrecognized expression: #rsmn_vehicle_make option[value=]. How could I change this to work with the latest version? $("#rsmn_vehicle_model option[value='<?php if(isset($qinfo['model'])){echo stripslashes($qinfo['model']);} ?>']").attr('selected','selected');
Strange behavior with $.unique()
The doc on $.unique() states thus: Description: Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers. ..... This function only works on plain JavaScript arrays of DOM elements, and is chiefly used internally by jQuery. You probably will never need to use it. I don't use this function; I have never needed to use it. However, I happened to be playing around with it and discovered something very strange. The
$.post not working on shared server but working locally
I have a script that sends some HTML to the server and server saves the HTML as a newsletter. the script works perfectly on my localhost, but, when i put it online, it doesnt. I checked the file permissions, the URL, the php file but nothing solved my problem I have been looking for a solutiin for this problem since last week: $.post("newslettersAPI.php", {id:newsletterID,templateID:templateID,content:content,subject:subject}, function(data){
Clickes Counter issue with fadeout.
Hello, I have been strugling with this for the last 6 hours. Any help. there is some thing wrong with it but I don't know what is it, it works but not every time. Here is the code sample : <!DOCTYPE html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"> </script> <script> $(document).ready(function(){ var clicked = false; var missedclicked = 0; setInterval(function(){ clicked = false; $("p").fadeIn(3000, function() { // Animation
Issue on Jquery Background Image Fade In and Out
I am trying to change a background image of a html5 canvas from dropdown select by using following code $('select').on('change', function() { if (this.value ==1){ $('#canvas').css('background-image').fadeOut(); $('#canvas').css({'background':'url(http://localhost/MapBox/img/cal_NAs.png) no-repeat top right,url(http://localhost/MapBox/img/bg_sh.png) no-repeat top right','background-color' : 'grey'}).fadeIn(); } }) but this is not doing the job and I am getting this error on console : Uncaught TypeError:
jQuery secure connection
I have been searching around but haven't quite found my answer. If I use jQuery on my mobile app and connect to an api/page to verify a login, is this secure, can anyone intercept the data? I have been reading things on encrypting the data that is being passed to my server and creating token keys being passed back and forth but if someone can see the data transfer it would be easy to post data to my PHP script right? Any help would be much appreciated. example below: $.ajax({ type: "POST",
How can I check the url outside of frame?
Hi guys, I'm trying to manipulate my content with jquery based on the URL. The script works as it should on desktop. But I'm having a problem with mobile app or mobile site, it doesn't capture the correct URL because the content is in iFrame. The problem is that the iFrame doesn't contain the content I'm after... Any one can advice the way I could make it work? Here is what I'm talking about: Example This is the script I'm executing: jQuery(document).ready(function(){ if (document.URL.indexOf("ebay.co.uk")
switching mp3 on secondary hover?
happy mondays all - wondering if there are any jquery heads on here that can help me out with something. i have some script in a page that triggers an audio clip when an area/image/text is moused over/clicked etc.... does anyone know how i can swap between two audio clips on a second, third rollover - or rather swap between the two triggerings. so on initial mouse over it plays 1.mp3 then when it is moused over again it plays 2.mp3... here is the script that is above the head... <script type='text/javascript'>//<![CDATA[
how initialize global variable inside a function
var t =' '; function k() { t="hello"; alert(t); // alerts hello } alert(t)// needs to alert hello
scroll to anchor only on data-anchor links
html <a name="anchor-0"></a> <a data-anchor="anchor-0" class="flex-item-1" href="#target-1">1</a> <a data-anchor="anchor-0" class="flex-item-1" href="#target-2">2</a> jquery $(document).ready(function() { function scrollToAnchor(e){ var aTag = $("a[name='anchor-0']"); $('html,body').animate({scrollTop: aTag.offset().top},'400'); e.preventDefault(); } $("a").data('anchor','anchor-0').click(function() { scrollToAnchor(); return false; });
initializing a global variable on refresh.
how to initialize a global variable after clicking the refresh button. var globvar; function refresh() { location.reload(); }
Add bullet to existing class
Here's what I have: <td class="ms-vb2"><a href="whatever">Text here</a> What I need to do is add a bullet around the anchor tag so it looks like this <td class="ms-vb2"> <li> <a href="whatever">Text here</a></li> Is there any way to do this using JQuery? Uncle D
Next Page