[jQuery] Append option to section list
I would like to know how to append a new option to a select list. I would also need to retreive the option value and value between the <option></option> tags, and create a new option: <select name="non_academic" id="non_academic"> <option value=""></option> <option value="19368">ghhfh</option> <option value="19369">test</option> <option value="19370">test</option> </select> I would like to be able to insert something like <option value="19371">test2</option> Both 19371 and test2 would be pulled from
[jQuery] jQuery Child Toggle Problems
I have a subset of links that I am trying to manipulate to create a breadcrumb with in an application. The trouble being that typically it seems the toggle event targets a particular element. I effectively need to only be able to add a class attrbute to only one element out of the subset of anchor links. does anyone have any quick ideas or examples? thanks
[jQuery] post ajax jquery
hi, i tryed do it <a href="http://www.malsup.com/jquery/form/#getting-started">http://www.malsup.com/jquery/form/#getting-started</a> but my form do submit normal, and not in ajax... so no return <code class="mix"><span class="com">callback function</span> somebody can help-me ? thanks code ------------ </code><pre><code class="mix"><span class="tag"><script type="text/javascript" src="lib/jquery.js"></script> <script type="text/javascript" src="lib/jquery.form.js"></script> <script type="text/javascript">
[jQuery] Trigger a key event with a particular keycode?
I need to manipulate a text input field -- enter a text and press "enter." How do I do that? $('div.name > input').val('value').trigger("keypress", ["13"]); didn't work, obviously.... Thanks. ari
[jQuery] $('foo').html(newhtml) loses bindings
Hey, Here's an outline of what I'm trying to accomplish: 1) Clone one div into another...maintaining events (works) 2) Append that html into a div (works) 3) Run a search and replace on the new contents (works) 4) Keep the events (doesn't work) Here's the code i'm using: $('.codex-relational-anchor').bind('click',function(){ //If the button is clicked for the first time, clear the divs contents if(iter == 0) $('.codex-relational- form').slideUp('fast').empty(); //Clone the contents of .manytomany-hidden
[jQuery] Retrieving the location of the mouse click within the browser window
I am trying to retrieve the location of the mouse click within the browser window. When a user clicks on an area that they thought was click-able but is not I want to record that location. There is a similar application already out there called heat click but I would like to create something more simpler in JQuery. I only need to add this to a couple of pages to see where there may be some issues with the layout of the web page. Right now I am using the following code but it it returning the offset
[jQuery] show/hide nested divs?
Hi all, I have code something like: <div id="box_1" class=box> <div id="close_1_a" class="closeimage_left"></div> <div id="title_1" class="boxtitle">Box Title</div> <div id="close_1_b" class="closeimage_right">Box Title</div> <div id="content_1" class="boxcontent">box content...</div> </div> <div id="box_2" class=box> <div id="close_2_a" class="closeimage_left"></div> <div id="title_2" class="boxtitle">Box Title</div> <div id="close_2_b" class="closeimage_right">Box Title</div> <div id="content_2"
[jQuery] Ajax and CSS classes
Using IE6 / WinXP SP2 / jQuery 1.2.3.pack Given an HTML nav list... <div id="navtoplist"> <ul> <li class="" id="tabHome"><a href="#" id="lnkHome">Home</a></li> <li class="current" id="tabSCFOX"><a href="#" id="lnkSCFox" class="TabLinks" rel="SCFOX">SCFox</a></li> </ul> </div> and CSS #navtoplist a, #navtoplist a:link, #navtoplist a:visited { float: left; display: block; color: #fff; margin: 0 1px 0 0; padding: 5px 10px; text-decoration: none; letter-spacing: 1px; background:
[jQuery] problem with animation()/stop()
Hello Everybody, Hope this is the right spot to place some suggestions for the GREAT jQuery Lib. How is it possible to use the fade() or fadeTo() method, if i want to toggle the an item e.g. a button with a fade on mouseover. the problem is, i have to stop the animation if i do a quick toggle over-out-over..., else the item will fade in and out many times. i tried all kinds of chaining with stop, unqeue etc.. but the behavior isn't controllable. iwould like to know a solution like toggleFadeIn: function()
[jQuery] $("#content").load('http://www.google.com.br') is a possible ?
Hi, I need loading http request inside my div content. I do this it $("#content").load("http://www.google.com.br"); but i hadn't sucess How i can load this page in my div ? tks..
simple question
hi why does this not work <script> function hideme(id){ $("#hideme-".$id).hide("slow"); } </script> ty
Selectors with $(this)
Hi, I try to use a hover on a page with thumbnails When I roll over a thumbnail, I want to change the color of the caption.. $('.drop-shadow').hover(function() { // this is what i want but only for the hovered image // $('.drop-shadow p').css({ color: "red" }); // try.. // $(this > "p").css({ color: "red" }); // $(this p).css({ color: "red" }); // $(this "p:last-child").css({ color: "red" }); // do i need to wrap 'this' in a jQuery object? //
Forms and dialogs
Hi all, I'm using a dialog for users input data. I use the plugin validation to validate the form. I've included two buttons in the dialog ( a OK button and a Cancel) and I do this with the options that the dialogs already has. My problem is: How can I force the validation when the user clicks in the Ok button. Can I link this button with the form? If anyone have done this before could tell me how do I do it? Cheers
toggle() and display:
I'm having trouble understanding how the display: options work when you use the toggle function. I have a form. With checkboxes next to an input field. If you uncheck the checkbox, the input field I want to disappear. You check it again and it reappears. Problem is with the css display: options. When the field re-appears using toggle() it comes back as display:block, and that throws off the design of the form. Even though I specifically set it as display:inline in my css to start out. My understanding
Input with autocomplete Jquery and xajax addAssign
Hello everybody ! I have a problem with an autocomplete function in Jquery on an element of the Dom that appears/disappears with a xajax function addAssign. The input with id 'destinations' is load at the beggining in a gloabl div and the function autocomplete works perfect. But when i change the content of the div with the addAssign function by clickling on a different tab and replacing this input by the same input with the same id the autocomplete doesn't work anymore ! I understand why, because
[jQuery] Binding submit events via Taconite
Hi guys, Due to the problem with IE unable to "rebind" onclick events, I am now binding click events via Taconite's EVAL command. All I want to do is, when the user clicks on the "submit" button, a "loading" animation to appear. Before going any further, please be aware that the way our app is designed, this is the only way to do it. So the submit INPUT is similar to: <input id="myinput" type="submit" onclick="$('#anim').show('fast')> Works fine. When the form is submitted, and the form is re-inserted
[jQuery] Help with forms
Hello everybody. I need help with one form. I created a form which contained data that has to be submitted both to a CRM but before the submit, I have to send an email with the data included in the form. As the CRM is in an external site, I can't manage the data once the form is submitted, How can send an email and then submit the form to the CRM? Thanks
[jQuery] Field Highlight when comparing form fields
Hi, I am trying to get a field highlighter working. I have a 2 column layout with a form in each. The form on the left is the 'original' data and the form on the right is newly updated. I would like to look at each form field and compare their values and if different add a class to highlight the change. I have the following code: http://rafb.net/p/UXZHd938.html The forms are quite large and this code basically kills the browser and I get a Slow script warning. Does anyone know if there is a way to
[jQuery] Jquery and Low Pro - an example
Hi folks! I wrote an article that walks through the construction of a Low Pro behavior for jquery and explains the reasons behind coupling the awesome low pro behavioral style with jquery: http://sudara.modernthings.net/2008/4/23/oh-behave-the-anatomy-of-jquery-and-low-pro-behaviors Low Pro started as a library for Prototype, but was recently ported over to jQuery by popular demand. For me, it is more of an attitude and approach to handling and organizing a LOT of behaviors. For larger apps, it's
[jQuery] jquery cycle plugin - displaying certain data problem
Hello ppl, I am havim problems with the jquery cycle plugin (http:// www.malsup.com/jquery/cycle/int2.html - the one titles "Callbacks". I modified it a bit so that it displays my, a bit larger images. Now, I do not want it to display the code which prints out the code needed the plugin to work correctly, but can't seem to solve this issue. My code is as follows: [BODY HTML CODE] <div id="main"> <div id="demos"> <table> <tr> <td> <div id="s5" class="pics"> <a href="1.html"><img src="res/images/banner_glavni.gif"
[jQuery] Tablesorter - Sorting a column with multiple tds
How do you sort a column that contains multiple tds? Look at this example: <table cellspacing="1" class="tablesorter"> <thead> <tr> <th colspan="2">first name</th> <th>last name</th> </tr> </thead> <tbody> <tr> <td><input type="checkbox" name="cb_1" /></td> <td>peter</td> <td>parker</td> </tr> <tr> <td><input type="checkbox" name="cb_2" /></td> <td>john</td> <td>hood</td> </tr> </tbody> </table> Clicking on the "first name" header should sort on the second cell of each row.
[jQuery] Annouce: idTabs 2.0
It's been a long time since I released idTabs 1.0 and I'm happy to say that a lot more people than I was expecting are using it. As time has passed, so has my programming style. I have completely recoded the structure and added a few options people requested. idTabs can now be bound dynamically, and via different events. <a href="http://www.sunsean.com/idTabs/">http://www.sunsean.com/idTabs/</a> Check it out and let me know if you have any troubles. ~Sean
[jQuery] load http:// with load() ??
Hi, I need loading http request inside my div content. I do this it $("#content").load("<a href="http://www.google.com.br">http://www.google.com.br</a>"); but not OK ?? How i can load this page in my div ? tks..<br clear="all"> -- att. Luciano M. <a href="http://www.m2t.com.br">www.m2t.com.br</a>
[jQuery] Adding a string to the end of links using Jquery?
Hi, Is it possible to add the string ?mytracker=yes onto the end of all links on my page using Qjuery?
[jQuery] Which jQuery method to use in this scenario
Guys, I am new with jQuery, and I was trying to do something very simple for you at least. I am using jQuery against classic ASP pages and I need to send a form to a ASP page and come back with XML results. So, question: Is there an easy way to just identify the FORM and send all the element values by default without actually building up the "value string" in the $.post method. $.post("process.asp", { name: "neualex", pass: "password" }, function(data){ alert(data); }); I review the documentation,
Converting popups to lightboxes using Jquery?
Hi, I have a link with the following code: <a onclick="javascript:void(window.open('link.html','popup','width=580,height=350,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,directories=no,status=no'));return false" href="link.html">More Info</a> There are several similar links on the page. Basically I'm using lightboxes on my other pages but don't have access to the source code, only the CSS so I'm looking if possible to change this using jquery. So in a couple of steps what I'm looking
[jQuery] Ajax Replacing HTML Using JSON
I'm having a strange problem using $.ajax. Better to illustrate with the code: function ajaxBind(trigger) { trigger.click(function(){ $.ajax({ type: "POST", url: $(this).attr('href'), data: { 'authenticity_token': $ ('input[name=authenticity_token]').val() }, dataType: 'json', beforeSend: function(xhr) { xhr.setRequestHeader("Accept", "application/json"); }, // json contains id and partial keys success: function(json) { $('#task' + json['task']).html(json['partial']); } }); return false; }); } When
[jQuery] trac code download
hi! i needed a fix for the color plugin so taht it works with transparent backgrounds. I found one ticket solves it: <a href="http://dev.jquery.com/attachment/ticket/2281/rgba.diff">http://dev.jquery.com/attachment/ticket/2281/rgba.diff</a> but i don't understand how to actually download the resulting code. Can someone shed a light ? thank you, <br clear="all"> -- Alexandre Plennevaux LAb[au] <a href="http://www.lab-au.com">http://www.lab-au.com</a>
[jQuery] onClick attribute filter broken in IE
Hi, var selectors = "a[href$=.pdf], [href$=.rtf], [href$=.ppt], [href $=.txt], [href$=.mp3], [href$=.xml], [href$=.exe], [href$=.zip], [href $=.rar], [href$=.dmg], [href$=.tar.Z], [href$=.tar.gz], [href$=.tgz]"; $(selectors).not("[onClick*=pageTracker._trackPageview]").click ( // Does stuff ) So the above code works fine in Firefox but errors in IE but I've managed to track the error down to the attribute filter. If i swap onClick with any other attribute the script won't error. Does anyone know
[jQuery] store the css current values of an element
Hi there ! i'm working on a plugin for my application, that needs to store the current value of all css properties of an element in the DOM. Do i have to store each property one by one or is it possible to just copy the entire css in one command? I tried: var myEl = new Object(); myEl.css = $('#helloworld').css(); But of course, that didn't work. Any help much appreciated !<br clear="all"> -- Alexandre Plennevaux LAb[au] <a href="http://www.lab-au.com">http://www.lab-au.com</a>
[jQuery] getting value out of datepicker
<div>Hi,</div> <div> </div> <div>I want to display some default date in a TextBox element. <font color="#0000ff"><</font><font color="#a31515">input</font> <font color="#ff0000">type</font><font color="#0000ff">="text"</font> <font color="#ff0000">id</font><font color="#0000ff">="startDate"</font> /></div> <div> I have bind datepicker to "<font color="#0000ff">startDate"</font> with some default date On document ready function. jQuery(<font color="#a31515">'#startDate'</font>).datepicker({defaultDate:
[jQuery] Testing jQuery (and jQuery UI) Components
How do you guys test jQuery UI components? If you’re reading this, you’re probably an expert JS developer, so you know how much the state of JavaScript testing sucks. Developers generally neglect JS testing because there’s really nothing out there that let's you simulate user interactions easily. So we built the Test plugin for JavaScriptMVC (http://javascriptmvc.com/ learningcenter/test/index.html) to do just that. It lets you simulate every major DOM event, as well as some combination events like
[jQuery] Problem positioning an absolute element
I recently implemented the following CSS layout on a site in place of a previous table layout: http://www.pmob.co.uk/temp/3colfixedtest_sourcenone.htm After doing so I cannot get DIVs to position correctly in some instances when using jQuery to do so. One in particular is too far down and over to the right. Unfortunately I don't have a page to show because the code is on a backend area that requires login. However, the code I was previously using that worked great to cause a box to display right
Code update - sticky footer
Hi, I have just basic knowledgement about JS. There I hope you can help me to alter some JS for a sticky footer. Code: // compute left offset of footer // fetch left margins if (navigator.appName.indexOf("Explorer") != -1) { leftMargin = 0.0+document.all.mainContent.offsetLeft+document.all.Container2.offsetLeft+"px" document.all.footer.style.left = leftMargin; } else { leftMargin = document.getElementById('leftMainMenu').offsetLeft+165.0+"px";
lightbox + database
hi, i'm newbie in jquery. is it possible to create a gallery that its images is from database and use lightbox plugin at the same time. thanks
[jQuery] is this a good way to test for the presence of a jquery plugin?
I am using this to test for the presence of blockUI if((typeof $.blockUI) === 'object') { // set up blockUI } also seems to work if((typeof $.fn.idTabs) === 'object') { $('.idTabs').idTabs(); } does'nt work if((typeof $.fn.jScrollPane) === 'object') { $('.scroll-pane').jScrollPane(); } it seems to not work with JSScrollBar though - so I thought perhaps there is a better way or should I go through the
[jQuery] event question
I have a click even that I add to a certain class when the page is created. There is the possibility of dynamically adding another element with that class, and I would like to have the same click even added. I'm just wondering what would happen if I registered the click event for that class, would that work? For instance: At page creation, this is run: $('.classname').click(function() { ... }); If I ran this after a new element with that class was created, would that screw anything up. I do have
Replacing HTML
I am quite new to JQuery. After some struggling through some guides and tutorials I am still not where I want to be. Maybe you guys can help me out. I am looking for an way to add an class to an specific string of html. Or hide the whole string. The string is: (where VARIABLE is some variable text) <li class="VARIABLE"><span>Cheese</span></li> How can I add an extra class to the li? Or delete/hide the whole string? Thanks in advance
[jQuery] getScript is great to add scripts dynamically, but how might you remove scripts?
Is it possible to remove a script from a page dynamically?
[jQuery] Forms
Hey, I have built a form and now I would like to add some ajax to it. Is it possible with jquery so load information into the form and also take the information from the form and update the database (PHP script for mysql part) If you can do this are there some examples around that would help me out and teach me? Many Thanks Chris
Next Page