Get the index of an element contained into an array, according to the event object
Hi, ive this code <div class="contStella" id="stellaquattro"><img class="stellaVota" src="immagini_sito/stella.png"/></div> Javascript + Jquery var stelleArray=new Array ( $('#stellauno'), $('#stelladue'), $('#stellatre'), $('#stellaquattro'), $('#stellacinque') ) $('#stellaquattro').mouseover(illuminastelle) function illuminastelle(event) { alert(stelleArray.indexOf(event.target)) // <-this retrive me "-1" that means that the element hasn't been found in the array } what's the solution?
Animating height with toogle gets sligthly higher and falls back
Hi I am trying to animate a div to the window center in a responsive way. Things work so far great except that somehow it animates a little bit higher then it should and falls back a little bit. I use jQuery 1.7, but the same is in 1.8. Here's the code: $(".core-dialog-box").animate({"width": "40%", "height": 'toggle', "top": '20%', 'left': '20%'}, 1500 , function() {}); Hope someone can give me a hint. Thanks in advance.
Bootstrap datepicker in bootstrap button drop down - jQuery event issue
My requirement : I am working on a twitter bootstrap button dropdown (http://twitter.github.io/bootstrap/components.html#buttonDropdowns) and using bootstrap-datepicker (http://eternicode.github.io/bootstrap-datepicker/#examples) in one of the list items as shown in below image. As per my requirement, I need to have month calendar in last item and clicking on that opens the bootstrap-datepicker and I should be able to select month & year. Problem I am facing : When I open that datepicker and select
jquery performance hit when loading plugins
Hi, I just wondered if anyone have noticed a several ms penalty when loading plugins. For my rather large web app its about 7-15ms per plugin, wether it is used on the page or not. Meaning that just plugging it into jquery causes it. Also it seems to cause this penalty wether the page has alot of dom or is fairly empty (though slight variations in time exists but I cannot say that they correlate with the dom size). As I am trying to cut loading time on all corners at the moment it kind of bothers
change initiate time of slider
Hello, I would like to build a navigation with 6 sublinks, each of them are images. The image of the sublink is supposed to change as in an autoplay slider every few seconds before starting again. At the moment I use two sliders, to create the effect based on a code I've found here. However I would like the second slider changing the image 5 seconds after the first slider has changed, so that the two sliders will never change the image at the same time. Thanks for your help, Regards, <!DOCTYPE
hey
guys i have a problem with cdn reference to use on desktop (localhost ) ,so i need cdn which does not require internet or a server.
hi
<!doctype html> <html> <head> <meta charset=utf-8/> <title>Mustache</title> <style> h2 span { color: gray; font-size: .8em; } </style> </head> <body> <ul class="tweets"> <script id="entry-template" type="text/x-handlebars-template"> {{#each this}}/* var data*/ <li> <h2>{{fullName author}}</h2> <p>{{{tweet}}}</p> {{#if quote}} <h5>{{quote}}</h5> {{else}} <h5>Author doest not have a quote.</h5> {{/if}} </li> {{/each}} </script> </ul> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
Rotated image and Chrome scrollbars - bugs.
Hi, Can anybody help with rotated images in Chrome/Chromium? When draggable image is rotated and image goes beyond browser window I can not hold scrollbar for page scrolling. Instead scrolling dragging event starts. Problem is on Windows and Linux with both vertical and horizontal scrollbars. I put video at YouTube that show problem http://www.youtube.com/watch?v=RyXzkv9fgUg Sample page: http://msdrop.com/?i=1056&f=11 Thanks Piotr *** Read about msDrop at jQuery Forum
jQuery.ajax() timing out intermittently
I have an ajax call that is timing out intermittently. I am doing ajax to a PHP site, I have put print statements at the exit() in the PHP file. The output shows the PHP site is responding correctly. The site responds typically in under two seconds. The error is at this line: if (jqXHR.status === 0) { alert(exception + ' Try again');} with exception containing :"Timeout" Here is the jquery call. $.ajax({type: 'POST', url: '<?php echo WP_PLUGIN_URL . '/ip3pdm/pdm/navigation.php'; ?>',
hide problem after load
y.html <div id="d1"><img id="close" src="close.png"></div> y1.html <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> <style> #d1{ position:fixed; width:400px; height:400px; background-color:#069; } </style> <input type="button" value="OK" /> <div id="main"></div> <script language="javascript"> $(document).ready(function(){ $("input[type='button']").bind('click',function(){ $("#main").load("y.html"); })
need help with script
I get this error Uncaught Error: cannot call methods on dialog prior to initialization; attempted to call method 'open' Here is my hrtml <!DOCTYPE htm l 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 http-equiv="X-UA-Compatible" content="IE=edge" /> <title>Expand table rows with jQuery - jExpand plugin - JankoAtWarpSpeed demos</title> <script type="text/javascript" src="js/jquery-1.9.1.js"></script>
Is Jquery / Ajax secure?
Is Jquery / Ajax secure? If i need to validate a password using Ajax. Will anyone be able toe read the sql using firebug. I need to find a way to do it secure. Thanks
Back & Forward buttons
Hi Everyone, I've a question on the Browser "Back" & "Front" button Description: I'm making an Ajax call and on success i'm updating the query string using pushstate - Before Ajax call the url is like this for eg: http://abc.com?params1=abc - After the Ajax call, the query string is updated as follows using "pushstate" http://abc.com?params1=def - Now when the user hits on "Back" button, its not doing anything. It remains as it is. I wanted to reload the page with the previous history state whihc
Looking for popup
I'm looking for a jQuery popup that looks like this: I've googled around and found a lot of popups but none like this. Before I go off and re-invent the wheel, anyone know of any code out there that does something like this?
Hiding page elements based on form "select"
Lets say I have a select in a form... <select name="selector" id="selector"> <option value="1">Option 1</option> <option value="2">Option 2</option> <option value="3">Option 3</option> </select> I want to show and hide some table rows based on the option selected so that the following table... <tr id="row1">Some Content</tr> <tr id="row2">Some Content</tr> <tr id="row3">Some Content</tr> will only show the row corresponding to the selected option. I know I can use $("#selector").val() to get the
.result and next()
what function jquery below : 1. $("#search-settingpayrollreport").result(log).next().click(function() { data = $(this).prev().search(); }); 2. $("#search-settingpayrollreport").result(function(event, data, formatted) { if(data) { $("#settingpayrollreport-id").val(data[1]); $('#btnCreate').attr('disabled','disabled'); $('#btnUpdate').removeAttr('disabled');
help show dialog return true false
some of my page content I cannot change as its generated by the server , for example my server generates this code <a href="#" id="deleteLink54" onclick="if(!confirm('Are you sure you want to delete?')) return false;var wcall=wicketAjaxGet('?x=z12gKfTAS1nMK-rWQvvTcgIWpk3l8d8hmfKCNYTSVUiA-t2d2o9eau0xd1*zS*exbWtaUKv-pe7zMozBPBI0FGcDSyZ3O7FJeZ6y1k0FlgEsF6MvnfsXPXOWplSlW9LK',function() { }.bind(this),function() { }.bind(this), function() {return Wicket.$('deleteLink54') != null;}.bind(this));return
Detecting files on computer
Is it possible with JQuery to detect the files in a specified folder on the computer and then do something with it? Like filling an arraylist with all the names of the files.
Simple DIV slideshow
Okay, so I'm pretty much the definition of newbie here.. Sorry if I've chosen the wrong forum to post in. This is meant to be a simple slideshow, so I can show off some customer testimonials. A couple of paragraphs of text and an image, all of which are formatted and positioned in CSS. The changing of the slides works as intended, but during the transition, the text from both divs are visible. The 'old' one appears below the 'new' one for the duration of the fade. This doesn't affect the image inside
CDN servering wrong SSL certificate
When I pull up https://code.jquery.com/jquery-1.8.3.min.js or jQuery UI or anything else, all browsers report a certificate error. Upon closer inspection, the certificate being served is for gp1.wac.edgecastcdn.net. This may be a localized issue--myself and two other developers all in the Seattle area. We're all connecting via Comcast pipes.
jQuery and UI reference in chm format, always latest
I dump the raw xml API and parse it into html with DISQUS comments integration. If some one know how to dump the xml API of UI reference, please let me know. I'll pack it with jQuery API reference. Thanks Edit: I have added the UI api reference and fixed some minus bug, user experience enhances! The latest compiled chm would be here https://github.com/Yahasana/jqdoc-parser
JQuery with Ajax
Hi , I am trying to call a ajax action on button click. But the ajax call is happening multiple times which is expected to happen only once. This issue is happening only when list of tables (whose data to be exported in excel) is more then 30 tables. The ajax call is called again approx every 3 minutes repeatedly. Please help me to solve this issue code template is as below :- $("#btn").click(function(){ var selectedValues = $('#tableNameList').val(); // list of tables of which data have to export
Fadin and out on images
Hi, I have 6 images, 5 of them is not displayed, the first one has a fadein effect, when the first image fades out i wanted the next image to fade in then fade out again and so as for the next image, how do i do this? Thank you...
Issue with onbeforeunload event to popup DOM window while closing browser
Hi, I am having issue in onbeforeunload event while loading div below is the detail of my issue. 1. Create aspx page. 2. write below code jQuery(document).ready(function() { alert("I am ready"); window.onbeforeunload = function() { alert("before"); $('.defaultDOMWindow').openDOMWindow({ height:175, width:300, windowSourceID:'#divBISSurveynew' }); } }); <div id="divBISSurveynew" style="display: none;" class="defaultDOMWindow" >Hello Survey!</div> on closing page survey div should popup. I am using
select parent followed by a different child
I am trying to make a script which when an object is clicked on highlights a specific child of that objects pearent here is my code HTML <div id="sam"> <p>This be a paragraph block</p> <p>This be a paragraph block</p> <p>This be a paragraph block</p> <p>This be a paragraph block</p> </div> CSS .highlight{ background:yellow; } Jquery $('p').click (function() { $(this).parent(nth-child(1)).toggleClass('highlight'); }); }); This is a learning exercise for me so i cant just take some
Using .load() in Chrome Greasemonkey script causes “Cannot call method 'call' of undefined”
I am using .load() in my Greasemonkey script in Chrome and it is producing the following error: Uncaught TypeError: Cannot call method 'call' of undefined (anonymous function) jQuery.extend.globalEval jQuery.fn.extend.domManip jQuery.fn.extend.append This error stops the alert() function in my code from occurring. My script can be seen here: http://www.metalmetalland.com/scripts/tumblr.js After installing it, simply browse to http://www.tumblr.com/tagged/dogs and view the console. An alert box
If conditions with jQuery objects
Hello, im new to jQuery and i am trying to use an if condition to not set back the styles from the html element with the class of selected. So im trying to compare the selected element with the element that is selected on hover. But it doesnt works. Here ist the code: $(document).ready(function(){ var selected = $('.selected'); $('a').mouseenter(function(){ $(this).animate({ backgroundColor: '#47F5FE', boxShadow: '0 0 5px #47F5FE', borderTopRightRadius: '5px', borderTopLeftRadius: '5px'
Waiting for the page to load
I am wondering if there is a way to stop the flashing of my image carousal. When the page loads there is a flash of the entire carousal then it goes back to the correct size after a half of a second. Is there anyway to stop the flashing? It is on this page among some of the others http://travisjterry.com/SBCorp/addon.php Any help would be great! Thanks,
JQuery + Ajax. Can you import XML from a script?
I know in ajax you can do the following, but my question is instead of sites.xml, can you use a python script 'script.py' to generate an xml object and pass it back to Ajax? $.ajax({ type: "GET", url: "sites.xml", dataType: "xml", success: function(xml) { } });
ajax external url php file
Hello jQuery, They need to upload huge files to ftp, because of the limitation of the plan, I have partially written and copy code to make this work. to use an external php fix this problem. code snippet 1: jQuery/javascript: <script> $(document).ready(function(){ $('#IDFormField_fileupload_0').change(function(){ var file = this.files[0]; name = file.name; size = file.size; type = file.type; //your validation }); $('#IDFormField_fileupload_0').change(function(){ var formData
jqGrid Number of Rows depending on screen size
I am trying to see if it would be a logical approach to decide on the number of rows in jqGrid based on screen size. Say for example if we are browsing from a tiny laptop, I can set the rows to 5 (to avoid redundant vertical scrollbar and make it friendly for the user). If I browse the application from a really big monitor, I can very well set to 100 or like that. Any suggestions to decide on this?
Copy table row and copy data from table column
Hi, I have poblem with some jquery code, can any one help me? My html code in http://jsfiddle.net/6Uv22/ I have couple of question. 1) I want copy blank tr row only if I write min one letter in last row. If I filled third row, I want new tr row as a fourth row. Only Name column are checked if is filled. 2) I want to show copy button. Copy button must be in between row (between first row and second row, second row and third row, and so on) and one button to copy all row. So if I have third row, I
Trying to get the right Object to animate.
http://jsfiddle.net/nakins/SUeyb/ I found some code that would open/expand and close/collapse a div. Once the Div was expanded, I needed to put in other clickable elements, so I removed the .box class, which worked. And, I did some other adding and removing of classes to get a "close" link. But, I'm not animating the original div, but animating the elements inside the div.. In this part of the code, shown below, closes the div. But I'm not sure what is pointing or referencing what. Is $(this) pointing
Unwarp doesn't update DOM properly??
I use: $(".Something", this).each(function(index){ $(this).contents().unwrap(); }); To unrwap some blocks such as: this <span class='Something'>is</span> a test ... the problem I then have is that when i step through the nodes, in both IE and Opera it steps through three text nodes: "this ", "is", " a test" ... I would have thought that the fact that i removed the span would combine the text back into one block as if the span never existed in the first place? Any ideas how to update the
How to tell my jquery hover slide out, not to build up a queue and stop and just slideout on mouseover and slide back in after a mousleave???
Hi all, first of all, thanks in advance for looking at this piece of jquery. This jquery piece should fold out three pictures only to the right, which is working perfectly. Thing is that because of the hover, it's building up a queue and when you hover over it three times or something like that, it doesn't slide back on mouseleave, but it stays slided out, because of this queue... I was told to add a stop function... So I tried...but it doesn't really work... I'm really an amateur on jquery, so
Jquery Ajax issue submitting with image
I have the following ajax code: $(document).ready(function () { $('body').on('click', '.addtocart', function(){ // Get the form data. This serializes the entire form. pritty easy huh! var form = new FormData($('#myform')[0]); // Make the ajax call $.ajax({ url: 'test.php', type: 'POST', xhr: function() { var myXhr = $.ajaxSettings.xhr(); if(myXhr.upload){
firing the server side click event
Hi, I have an ASP.NET datalist <asp:DataList ID="appointmentList" runat="server" Width="100%"> <ItemTemplate> <div class="appointment"> <div style="float: left; display: inline-block; width: 75%;"> <asp:Label Font-Bold="true" ID="type" runat="server" Text='<%# Eval("AppointmentCategoryDescription") %>'></asp:Label> - <asp:Label ID="date" runat="server" Text='<%# DateTime.Parse(Eval("AppDate").ToString()).ToShortDateString()
issue with jquery tab event
Hi, i am working on jquery. and in my project i have used the following code, but whenver i select a tab and refresh.it reolads with the first tab and its contents. but not with the selected tab and its contents. is there any issue with the .js file as i am using jquery1.9.1. <ul id="myTab" class="nav nav-tabs"> <li class="cooldrinks"> <a href="#pepsi" data-toggle="tab">pepsi </a><span class="limca"></span> </li> <li class="coke"> <a href="#coke" data-toggle="tab">coke</a><span class="limca"></span>
returning data to ajax call
I'm invoking a python script from an ajax call (using django) and I want to return data. I've never done this before. I've been reading examples on the web and I came up with this: $.ajax({ url: 'permalink/', type: 'GET', data: { report: "{% url motor.core.reports.views.view the_controller.app.name the_controller.get_name %}", params: "{{ the_report.params_string }}" }, dataType: 'json', success: function (data) { setTimeout(function () {
JQuery Validation does not work on hidden elements
I am trying to validate a number of forms some of which are collapsed,I can validate the forms that are shown but I can not validate the ones that are collapsed. And I also have tried "ignore". I guess if you tell me how to validate the hidden elements my problem would be solved. I really appreciate your help.
Next Page