Using :first Selector with .prevAll() and Multiple Elements
So I've Googled the .prev(".class") issue and found the solution, .prevAll(".class:first"). However, that doesn't seem to work with multiple matched elements. The :first selector seems to be applied to the entire list at the end, what I would expect .prevAll(".class").first() to do. What I would rather have happen is the selector be applied to each element in the "result set". Does this seem to be a bug or rather just how jQuery works? <!DOCTYPE html> <html><head> <title>jQuery .prevAll() Selector
common value in 2 arrays
I'm trying to find a common value between two arrays. In this case I have two select drop downs and each option has multiple classes assigned. There will always be 1 class value that is common in both selected options. <select id="optionSel1"> <option class="sku0" value="" selected="selected">-- Select --</option> <option class="sku7 sku8" value="2">female</option> <option class="sku10 sku9" value="1">male</option> </select> <select id="optionSel2"> <option class="sku0" selected="selected">--
How to create infinite loop with slidetoggle()?
in jquery, what is the easiest way to automatically slidetoggle an object every 3 seconds after the page loads? I basically want the object to open its mouth for 3 seconds, then close his mouth for 3 seconds, then open his mouth for 3 seconds, infinity. thanks! *Break through the ice and never look back*
.remove not working
For some reason this will not remove the <li> items generated from Parse API. Although it will remove the <li> items that are already on the DOM. Is this a Parse API problem or jQuery? Here's the HTML: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Andria Jade, Ceramics Portfolio</title> <meta name="Adam Yost" content="Check List"> <link rel="stylesheet" href="reset.css"> <link rel="stylesheet" href="styles.css"> <!--[if
Toggle class for images
I have a series of images that a user can select. I want to change the mouse pointer when they hover over the each image. I want to display the image with a red border after they select it. Each image is set up like this: <asp:Image ID="imgHorse" src="../Images/Horse.png" class="SelectableImage" runat="server" alt="Horse"/> My JQuery is as follows: <script type="text/javascript"> // Bind hover and click events to images $(".SelectableImage")
jQuery selector?
I have a table defined like below from a server generated page. I'm trying to get a handle to the <thead> portion so that I can add another heading. I'm not quite sure how to do this with jQuery. I did it by traversing the DOM and somehow was able to do what I wanted, but I want to know how to do it for future reference. Can someone help? Thank you in advance for your help. <div class="zendiv" id="ExpenseSubTable" zen="86" style="height: 394px;"> <table class="tpTable" border="1" cellspacing="0"
How to change style for disabled option in a select menu?
Hi I am disabling some options in a select menu and enable the rest but i like to give class to the disable item. I want to change the color and put a image background to those disabled items how can i change the color and add a background image? here are my code to disable options for(var i = 0; i <= 86400; i += 1800){ var seconds = i.toString(); var newTime = i.toHHMMSS(); var titleSec = fromHHMMSS(title); //this needs to be converted to seconds if(i < titleSec){ $('#startTime option[value="'
Ajax looping by design - pitfalls?
I need some sort of transactional client/server/client processing - My expected solution is Ajax Send. If Ajax Error were to be called, it would call Ajax Send again to retry. Does anyone know of potential pitfalls that this might create when it comes to client memory usage? I'm using jQuery 1.8 (I need to recode to upgrade to 1.9 and am holding off on that for a month or so). Thanks!
Insert the scrollbar value into input field
Hi I've this script, inspired by the codrops slider pagination concept http://tympanus.net/codrops/2012/12/21/slider-pagination-concept/ I'd like to put the value obtained by the slider into an input field value (i.e. <input type="text" value="((slider value here !))"> ) instead of into the div#preview. How can I do ? Thanks KD <div class="container"> <div id="preview" type="text" class="preview">0</div> <div id="slider" class="sp-slider-wrapper">
Spinner widget event.
Hallo everybody, I need help to execute php file when I click on the button to increment or to decrement the value in spinner widget. Thanks in advance.
when i try run jquery slider in liferay 6 portlet i found the error
Uncaught TypeError: Cannot call method 'appendTo' of undefined tms-0.3.js:359 $.extend.bannersFutms-0.3.js:359 $.extend.inittms-0.3.js:524 window._TMS.$.fn._TMStms-0.3.js:7 (anonymous function)services:1 jQuery.event.handlejquery.1.6.0.js:2865 elemData.handle.eventHandlejquery.1.6.0.js:2499 i tried lot but i can't resolve the errror. I think it is problem of the flow if including js in view.jsp. My flow of including js in view.jsp <link rel="stylesheet" href="/HEADER-portlet/css/main.css" type="text/css"
jQuery hide() and a normal form
Hello, I created a new HTML document which appears a menu on the left side of the document: <!DOCTYPE html> <html lang="de"> <head> <meta charset="utf-8" /> <title>Test</title> <link rel="icon" type="image/x-icon" href="favicon.ico" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js"></script> <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.0/themes/dark-hive/jquery-ui.css"
Not able to register JQuery script via asp.net "ScriptManager.RegisterStartupScript"
Hi All, I am working with asp.net & jquery. I have created several function & attached events(click, change, mouseover etc) to my controls. All is working fine except one thing. 1. If I declare any variable inside jquery block like below: $(function(){ var _x=false; function _foo(){ alert('Some Text'); } }); & If I try to set value of _x or If I want to call function _foo by registering the script via .net page, I am getting the error.
Why don't jq have consistent args order in ajax done() and fail()?
The arguments order in ajax callbacks are inconsistent. It is not stable in always() callback. jqXHR.done(function(data, textStatus, jqXHR) {}); jqXHR.fail(function(jqXHR, textStatus, errorThrown) {}); jqXHR.always(function(data|jqXHR, textStatus, jqXHR|errorThrown) { }); I think it will be better to change the fail arguments order to (errorThrown, textStatus, jqXHR).
Norton Internet Security causes glitch in jQuery slideshow in Chrome on a PC
I've written a jQuery slide show that runs fine on a PC in Firefox, IE, and Safari. It runs fine in Chrome when NIS is disabled. But with NIS enabled, there's a glitch. At the end of each dissolve, the previous slide flashes briefly on the screen. You can see the slide show at www.kayanphoto.com The name of the slide show script is crossfadePro Any suggestions for fixing this glitch?
[jQuery] [validate] Test element validation without triggering error message display?
How would I check if the value of a given text field is valid according to the rules specified with the Validation plugin (returning true or false) without triggering validation? Like using validation().element(el) or $(el).valid() - purely for the returned boolean - without the error message showing if it is invalid. I do not wish to remove the error message altogether, rather I am looking for a way to test the validation of the field without setting it’s validation state as far as the plugin is
Node created with the "$" function is already cached?
Hey! When you create onde DOM node with the "$" function, it's possible to manipulate and define some properties before the DOM insertion, like one pure Javascript node creation. But, when the node is inserted (using one off various jQuery "append" functions), that variable used to assign the "$" object return can be manipulated as reference to the node already inserted, or one new reference, now for the new node? Like, call the element "again" with some selector on the "$" function is necessary
List Item's Divider Selector
This is related to jQuery Mobile but specific to a jQuery selector. Is it possible to have a selector find a specific list-item's divider (if one)? For example; <ul data-role="listview"> <li data-role="list-divider">A List Divider</li> <li><a href="#">A List Item</a></li> <li><a href="#">B List Item</a></li> <li data-role="list-divider">FIND ME</li> <li><a href="#">Another Item</a></li> <li data-important="true"><a href="#">GET MY DIVIDER</a></li> <li><a
Append and remove an element
I am currently designing a web page using javascript, html and css. The page is a seat booking seat which allows the user to select and unselect seats. I have managed to get the page to display id of the seat when the user have selected a seat, but I am having problems trying to remove id from the display if user unselects the seat. Below is the javascript code $('.available, .unavailable, .selected').click(function(){ var ID = $(this).attr('class'); if (ID == 'n unavailable' || ID == 'p unavailable')
Why index giving incorrect index number
Following is my code. I am getting index 0, but not 1 and 2. Any suggestion is greatly appreciate... <html> <head> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <select id='selectCombo'> <option value='v1' class='c1'>v1</option> <option value='v2' class='c1'>v2</option> <option value='v3' class='c1'>v3</option> <option value='v4' class='c2'>v4</option> <option value='v5' class='c2'>v5</option> <option value='v6' class='c2'>v6</option> <option value='v7' class='c3'>v7</option>
loop through all values of listbox
Hi, I have a listbox which has multiple values. Values are seperated by a pipe symbol ( | ) . example: tAM|t |t |t36|tPM |t |t37 How to loop through the listbox and get the values "AM" and "PM" Thanks
query-1.9.0.min.js error 80020101
Hi All, I have published a mvc web app using jquery-1.9.0.min.js to two locations: 1. Windows server 2008 with IIS 7.5 When I load the web site I get the following error: Message: Could not complete the operation due to error 80020101. Line: 1 Char: 15501 Code: 0 URI: http://servername/websitename/Scripts/jquery-1.9.0.min.js 2. Locally (laptop) with IIS 7.5 No errors even though the website that has been published is exactly the same, as so is the browser being used to access both, IE9 Could someone
How do I add event handler to dynamically created checkbox in jquery?
I am adding multiple check boxes dynamically on my page, but when I click them not any of click or change event is firing. I tried following code but its not working: $(".selectItem").live('click', function(){ alert('test'); }); .selectItem is class for all check boxes. Can any one help me solving this problem. Do any one need more info?
JQuery IF statement issue
i have this JQuery code, if ($('#lblProteinsApoklisi').val() >= 0) { $('#lblProteinsApoklisi').addClass('UnderStats'); } else { $('#lblProteinsApoklisi').addClass('OverStats'); } if the textbox has a negative number i just put a background color of red, else a background color of red. No errors are shown but the .addClass doesnt seem to work. Thanks in advance.
How to convert hh:mm:ss string to time and add 30 minutes to it?
Hi I have Time string like so 15:00:00 which is 3 PM. Now I want to convert that to a number so i can add minutes to it and then convert it back to the hh:mm:ss format so I want to create a loop starts at 00:00:00 and go up to 15:30:00 then display the value. I have done this is PHP but i need to do it in jQuery $time = strtotime("00:00:00"); for($i = 0;$i < 48;$i++) { $time = strtotime("+ 30 minutes",$time); $key = date("H:i:s",$time); $display = date("g:i A",$time); $menu .= $display. '<br />';
Simplest way to replace a classname on set of elements?
Looking through the API, I can't see a "replaceClass()" method, but I want to do this: $("div.class-to-replace").removeClass("class-to-replace").addClass("class-to-replace-it-with") Is there a single method to do the above, or a better way? Or is that indeed the most common way it's done?
i cant getting element value (for inlineedit)
inded.php while ($row = mysql_fetch_array($result)) { echo' <tr> <td class="inlineEdit"><div>'.$row["id"].'</div></td> <td class="inlineEdit"><div id="c1_'.$row["id"].'">'.$row["first_name"] .'</div></td> <td class="inlineEdit"><div id="c2_'.$row["id"].'">'.$row["last_name"] .'</div></td> <td class="inlineEdit"><div id="c3_'.$row["id"].'">'.$row["email"] .'</div></td> <td class="inlineEdit"><div id="c4_'.$row["id"].'">'.$row["hire_date"]
Issue while trying to remove a div was created by .append()
Hi I have a drop down menu and the menu have numbers from 1 - 24 by default i have 1 div created and when the use change the menu i add divs acordanly. so if i user selected number 5 from the menu i will append 4 new divs which is total of 5 including the default. But When then used go from 5 to 3 i will have to remove the last 2 div that we generated by .append() i have used .live().remove() to do that but it is not working. when i say it is not working i mean the remove function does not remove
datepicker() for inputs were created on fly?
Hi I am using the datepicker UI for date selection so i created some inputs on the fly using jquery. But the datepicker it now working on those that were created using jquery here is few thing that i have tried (none of them is working!) Thanks $( "input[id^='checkDate_']" ).live( 'click', function(){ datepicker({ changeMonth: true, dateFormat: "dd-mm-yy", yearRange: "c-1:c+1", changeYear: true }); }); $( "input[id^='checkDate_']" ).live().datepicker({ changeMonth: true, dateFormat: "dd-mm-yy",
Making this website more *awesome*!
Hi, I am currently developing a website that revolves around music during the Second World War. This is in connection with a music education project. The website is a tool that should make history lessons on the Second World War more interesting and of course that it could be used in music lessons. It's aimed for both teachers and students in class. I work from a specific vector style which has been accepted by the commissioner, together with the concept. However, I wondered how I could make this
Save data stored in table in array
Dear All I have following table and want to save data(update database) when clicked on save button using JQUERY This being in array I was confused as how to access the values in Please SelectBangaliEnglishGujarathiHindiKannadaMalyalamMarathiTamilTelagu Please SelectArticles-Biographical (Revolutionaries)AutobiographyDramaEsseys - RationalistEsseys - SocialEsseys- Political Esseys-- HistoricalHistoryLettersMiscNovelsPampletPoetrySatire -PoliticalSatire SocialShort StoriesSpeechesStatementsThesis
JQuery does not fire after updating a panel
I have a an update panel like this: <asp:UpdatePanel ID="UpdateCost11" runat="server" autopostback="true"> <ContentTemplate> <div class="rowContainerBorder" style="height: auto; text-align: center; clear: both;"> <asp:Label ID="Label1" runat="server" EnableViewState="false" ForeColor="Red"></asp:Label> <asp:GridView ID="gvwProjectCost11" runat="server" AutoGenerateColumns="False" DataKeyNames="Id"
Problem to start a script after an ajax response
I have a HTML code like this: <!DOCTYPE html> <html lang="en"> <head> <title>Test</title> <meta charset="utf-8"> <script src="js/jquery-1.9.0.js"></script> <script> $(function buttA() { $("#buttA").click(function(){ alert ("Hello from buttonA"); }); }); $(function buttB() { $("#buttB").click(function(){ alert ("Hello from buttonB"); }); }); $(function bReq() { $("#bReq").click(function(){ $.ajax({ url:"test.php", type:"post",
HTML Editor Plugin
I'm looking for a html editor plugin for my application My requirement is I need to see a preview while I'm typing in the textbox like the question field in stack over flow I tried some plugins but they didnt support the preview function... Is anyone know something please share.. Thanks in Advance
Jquery with post to open a pdf generated with aspx
Hello, I've got a Silverlight application, I call a javascript function defined as function test(dateStart,dateEnd,idGauge,description) { $.post('content/ShowHistoricalReport.aspx', { dateStart: dateStart, dateEnd: dateEnd, selectedGauge: idGauge, description: description }, function (data) { var win = window.open('about:blank'); with (win.document) { open(); write(data);
animate performance with large amount of elements
Hi, I want to use animate function in a page that has more than 3000 elements in it. (they are images or divs) But the animate function works for 200 elements max. I've tested it in 5 different browsers. How can I use it for a larger amount of elements in the page. Regards, Amin
not able to access json data
HI, i am not able to access the json data through query. Please let me know why.. i have tried so may ways. below is my script: $(document).ready( function () { $.getJSON("new.json",function(data) { var html = ""; alert(data[0].content[1].css); for(var i=0,size=data.length;i<size;i++){ alert("pallavi" +data.length); html += '<div class='+data[0].content[i].css+' id='+data[0].content[i].id+'></div>'; } $('#clickCall').append(html); }); }); below is my json: [ { {
Question for Jake
Jake, u helped me that json part. but the css which i had written for that html, is not getting applied now. why is that?
inputs created by jQuery "on the fly" will disappears if you go back to correct errors
Hi I created few inputs on the fly with jQuery. but if an error cought on php side then you have to go back to correct errors they all disappears. I can see the problem and why it is caused. but how can I fix this issue? is there a trick to keep them when i click go back? here is how I add those input fields //append fields for(var i = inUseTotalCheck+1; i <= totalToUse; ++i){ $('#checkListPanel').append( '<div class="label-input" id="check_' + i + '">' + '<input type="text" id="checknumber_' + i
Load different HTML content into same #Content DIV on clicking different buttons?
How can I animate a div to the same position as another div...?
Next Page