[jQuery] can't change values in appended divs
hello all, i'm allowing users to append and remove divs at will. the divs are numbered. if there are 5 divs and user removes div #2 i need to subtract 1 from divs #3,4,5 so that they become divs #2,3,4. here is my appending code: $('#schematics_main').append("<div id='hotspot_" + total_hotspots + "' class='jqDnR'><div class='rhs'>" + total_hotspots + "</div><div class='jqHandle jqDrag'>HS "+ (total_hotspots+1) + "</div><p class=\"removehs\">Remove<div class='jqHandle jqResize'></div><input name='hotspot_"
[jQuery] Bind resize of window doesn't run when in fullscreen(opening a sidebar for example)
here's my code: $(document).ready(function() { $(window).bind("resize", function(){ iframesize(); }); function iframesize(){ wheight = $(window).height(); // wwidth = $(window).width(); $('iframe').height(wheight - 30); // $('iframe').width(wwidth); }; iframesize(); }); When not in fullscreen mode and opening a sidebar or firebug etc in firefox the bind resize callback runs but when in fullscreen mode it doesn't. How do I make it bind to resize also in fullscreen mode?
[jQuery] multiple event handlers and sequence
Is there any way to control the order of multiple event handlers registered? If not, does anyone have an idea of how to make a form that uses onchange to submit the form ( i.e. i don't want a submit button i just want the form to submit when someone leaves a field, provided everything has been filled out ), but also wants to use onchange to validate data, and possibly do other things?
[jQuery] [validate] write a metadata within group
I wish use groups option to display a single message for multiple elements, but with metadata behavior. Something like that: <input type="text" name="t1" class="{groups: { g1: "t1 t2"}, requered:true, number:true,messages:{required:'Please a text.',number:'Please only numbers!'}}" /> <input type="text" name="t2" /> How to do right mode with metadata? Thz!!
[jQuery] Sort of like tabs... need to start with a random div and swap it out when clicking a link
I think I'm pretty close to getting this to work, but it's not quite. This is essentially tab functionality, but the initially showing div needs to be randomly chosen. I can either show the random div initially, but then the links don't work. Alternatively, I can make the links work, but then I can't get the random div. The code I'm including shows working links. To (attempt to) show the random div, I'm using this http://www.leftrightdesigns.com/library/jquery/randomchild/jquery.randomchild.js The
[jQuery] no callback for css/addClass?
i guess it makes sense since in most cases its instant but it would be useful to have a callback as in: $('#myDiv').css('color','red', function(){ alert('color changed!'); }); addClass() doesnt have a callback either... is there any particular reason for this? thanks!
[jQuery] Getting Superfish menus to overlap in IE
Hey, So i spent a large portion of work on Friday trying for the life of me to understand how to get the Superfish menus to overlap in IE. Here is the scenario that warranted them overlapping in the first place: The menu is horizontally across the top of the page and naturally the last menu is about 3 menus deep so it goes off the page even on a 1280x1024 screen. So the solution is naturally going to be to have the menus overlap some (menu width of about 16em and so we have them to the left by only
[jQuery] - Object Oriented / PHP5 - Possible BUG with Jquery
<div dir="ltr">Object Oriented / PHP5 - Possible BUG with Jquery Hi Folks I was creating a simple singleton class (but I tested with others Desing Patterns) with php like this: class header { static private $instance = false; private function js() { <script type="text/javascript">$(document).ready(function() { $("#out").each(function(i){ $(this).bind("click", function(event){ document.form.submit(); });
[jQuery] Form submitted twice in IE ?
I have a fairly complex jquery-based form in a ColdFusion back-end app, with a tabbed interface that fires validation on each tab change, as well as on submit. Lots of moving parts. I don't think there's anything wrong here, works fine... The problem is that in IE, the form is getting submitted twice to my CF page. With Firefox, no problems... clicking the 'submit' button or hitting 'enter' in any field causes the form to be submitted only one time as expected. However, in IE7, either clicking 'submit'
[jQuery] Backward compatibility & Roadmap
Are the new releases of jquery backward compatible with the old code? Are there any roadmap for jquery? I haven't found any ... For instance will jquery 1.3 support old 1.2 or 1.1 code ? Have you ever faced with the problem of a new browser and your written code not working in it? Thanks in advance!
[jQuery] tabs and form plugin integration
<div dir="ltr">Hi all. I'm building a form which contains 4 sub-forms available like tabs. I'm looking for examples about how to integrate jquery tabs with form validation plugin. Cheers Marco Antonio </div>
[jQuery] Superfish jQuery competing with other js files
So I have Superfish running just fine on my site right now except for one small problem. I have a page that was designed previously and it is using LightWindow. Now for those that don't know what LightWindow is, look here: http://www.stickmanlabs.com/lightwindow/ What is happening is that the jQuery for Superfish is competing with the JS for LightWindow. Since Superfish is the more recently added file (and it wasn't doing this before I added Superfish) I was thinking that maybe I could edit some
[jQuery] this.style is null or not an object
Hi, I'm developing on ASP.NET and have been trying to make the SimpleModal plugin work but somehow the jQuery.hide() function throws an error 'this.style is null or not an object'. This is my jQuery code: jQuery(document).ready(function(){ jQuery('#showError').modal(); }); Thanks.
[jQuery] Jquery/Tabbed interface only working in FF, broken in IE, Chrome, Opera
Hi. My name is Craig and I am a copywriter for an African travel company based in Cape Town, South Africa. I have no web development background, however my girlfriend is a photographer and after seeing how much developers wanted to charge her for a simple gallery based site, I decided to give it a go myself. Turns out, it's not that easy First I used a Jquery based script called stepCarousel from dynamicdrive.com. That was to make a sliding image gallery and also for the thumbnails. http://www.tessaholding.co.za/home.html
[jQuery] Superfish v1.4.8 using two menus one under another
Hello, I'm trying to use Superfish v1.4.8 with two menus located one under another. Everything looks almost great except for IE6 -- the dropdowns from the top menu open behind the bottom menu items. Does anyone know if there is a fix for this issue? Thank you.
[jQuery] Toggle Only the <dd> below the <dt> on click
This is probably a noob question but... I have a bunch of definition lists on a page with the same class so that I can stripe every other <dd> in the list. What I want to do is hide the <dd> elements and when I click on the <dt> toggle the <dd> elements to visible. I want this to happen only on the <dd> elements in the same definition list as the title I am clicking, not all the <dd> elements on the entire page. What is happening now is that all of the <dd> in all of my definition lists are being
[jQuery] Tablesorter - How to detect which header cell was clicked? (in sortStart/sortEnd callbacks)
Hi there, When using the excellent tablesorter plugin, I need to intercept the click event to remove irrelevent rows from the table before the columns are sorted (and put some back after sorting). The sortStart/sortEnd callbacks are called at the right time but how do I find out which cell (column header) was clicked? (More info: The "irrelevent rows" I mentioned are actually headings for groups of associated rows. I need to remove those headings just before a sort starts, then put them back afterwards
[jQuery] ajax post to ruby script
Hello! Sorry for the n00b post, but i've come to a dead end. I'm trying to write an ajax callback to a Ruby script that does a simple database update. I'm having trouble with the syntax I think. Here's what I've been trying: $("#jLink").click(function() { $.ajax({ type: "POST", url: "testing.rb", data: "name=ryan", success: function(msg){ alert( "Data Saved: " + msg ); } });
[jQuery] Toggle Issue - Firefox/Safari Mac
Hi All, I have a maddening issue that I cannot seem to get my head around. I have written a form in which, if you select a certain radio button, it will toggle additional fields. The code I've written is: //form40 coapp yes/no toggle function $(document).ready(function() { // hide on DOM load $("tr.coapp").hide(); // shows co-app tr's on YES click $("input#COAPPYES").bind("click", function(e) { $("tr.coapp").toggle(); }); // hides co-app tr's on NO click $('input#COAPPNO').bind("click", function(e)
Help need regarding capturing the drag & drop events.
Hello I am new to Jquery. I am using Jquery UI framework. I am showing number of widgets in a page. I need to store the states (order) of each widget. For this I am trying to capture the drag & drop events. But i am not able capture drag & drop event. Can anyone help me.
[jQuery] jQuery animate function + IE
Hi, I got some buttons to show the prev/next image or to close it 'cause it is allready big, in front of the others and draggable. This code works in every browser except for IE. IE doesn't go through the function of animate(). so he doesn't remove the div and the first image doesn't get visible. I don't get why. maybe someone can see the mistake or whatever. I'll be thankful about every help or ideas. The code of my close button (all 3 buttons got this code): $(".close-button").one("click",(function()
[jQuery] Click event for anchor tag goes to url in href attribute
Hi, I have an anchor tag like <a href="/foo" class="delete" id="1">delete</ a> I have attached a click event to the tag which does a POST request to the url by doing $("a.delete").click(function () { $.post(url, {"id":id}, function(data){ console.log(data.msg); }); }); The POST request goes throught, but after that - a GET request goes to the server because of the link click. Is there any way to solve this? Is this the right way to do it?
[jQuery] Superfish image buttons for main menu items only
Help please. Does anyone have a working example with over/out buttons for main menu items? The submenus are all text-based. I am trying to build one with separate buttons for each state, but am open to building with multiple states in a single image and just adjusting the position accordingly on hover. I've searched the group, but have not found one. I did find some references but the example links were 404d.
[jQuery] superfish image buttons
Hello, I've searched the List and read the entries. The problem is that I could not get them to work. I'm ok with css, certainly not a pro. I'm better with javascript and PHP. Here's the bit of css that I modified from another post to this List... #community a { background: transparent url(images/topnav/ community.gif) no-repeat 0 0; } #community:hover a, #community.sfHover a { background-image: url(images/topnav/community_on.gif); } The images are correct, the paths that is. I can not get them to
[jQuery] Sortable treeview
Dear folks, does any one know how could we have a nested sortable treeview , as what jorn has did !! Regards Pedram
[jQuery] why is this code inefficient?
I thought I was getting the hang of jquery and javascript, but then i wrote this small function, and it is really taking a long to run - like 15+ seconds. The purpose of the function is that i have a list of concerts ordered by date. I want to show the date when the date changes, so for all concerts on Wed, Sep 24, I show the date as a heading on the first concert, and then hide the rest of the date headings, and then for concerts on Thur Sep 25, the date shows again on the first item, so users know
[jQuery] Add Class to matched href location Click to flag this post
Im having trouble getting this to work, I feel like Im really close. Does anyone have any idea? var path = location.pathname.substring(1); if (a[@href == path]) { $('.nav ul#example li.addClass('active')); }
[jQuery] Using variables in selectors
Hi all, I'm frustrated because this does not work: var pageName = "foobar.html"; var link = $("a[href$=pageName]"); link.addClass('selected'); The problem lies within the fact that it seems the jQuery selector I use in the second line does not allow variables. It only works with a hard-coded string (so it seems). So, this does work: var link = $("a[href$='foobar.html']"); link.addClass('selected'); I must use a variable, though, because (as you might guess), i'm trying to highlight my navigation
[jQuery] Comment posting using Jquery
Hello guys I'm a php programmer and I love the idea of jquery not to have to load page after page for each thing that happens in a website, I've look into it and I want to try it out. The fisrt script i want to make using jquery is a comment form, that submits the comment and if the comment is accepted then display on the site without having to reload... So I ask you advanced jquery users what plugins do you recommend and hopefully some examples or something to start with, Thanks.
[jQuery] Cant get a rich textarea value (using tinymce)
I'm trying to add a 'save as draft' button to a mail sending form, when the user clicks on that button, i send the form data to the server by ajax to save it, but my problem is there's a rich edit that i cant get its value. Here's my textarea: <textarea name="body" id="i_body"></textarea> Using this code: console.log($('#i_body').val()); It returns exactly what i have in the textarea: that's OK ! Now, i switch to richedit, my textarea becomes like this: <script type="text/javascript"> //<![CDATA[
[jQuery] treeController [treeview]
I need an example on how to correctly use treeController for the treeview plugin (http://docs.jquery.com/Plugins/Treeview/treeview) Many thanks!
[jQuery] Trying to create a function in flashembed that launches facebox - need syntax help
This is the function: function onClipDone(clip) { jQuery.facebox(function(){ jQuery.html('#capturePane') }); }; The facebox loads, but then the HTML string will not render. Any ideas? You can see it live here: http://ui.davemerwin.com/video-surprise/
[jQuery] Scale back to original size using percent or?
Hello, I'm using the scale effect and after scaling up, I'd like to scale back down to the original size of the image. I haven't found a way that will get me back to the original image size using "percentage." I've tried something like this: var scaleFactor = 3.5; unscaledImgWidth = $(".img").width(); // scale up. $(".img").effect("scale", { percent: (scaleFactor * 100) }, 600); // scale down. $(".img").effect("scale", { percent: ((unscaledImgWidth / scaledWidth) * 100) }, 600); My scale down doesn't
[jQuery] validate
I noticed today that if I type in say 01/01/2001 it will validate correctly.. which it should... however if I type in 01/01 2001 it also will... which it shouldn't... thanks
[jQuery] ready() function different when inside a frame?
I have a frame that I want to use the same instance of jquery as in the parent window. Here is what I did: $ = window.parent.$; $(function() { $("#test").click(function() { $("#hold").append('<a href="#">Inserted from iFrame</a> <br />'); }); }); For some reason, the click event is not being bound, and the html is not getting appended. BUT, if I remove the click function, and just load the page without it, it DOES correctly get inserted into the parent. What is going on here? And why can't I get
[jQuery] IE issue... load order, DOM, event handling... ? help please!
Hi all. I'm working on a site where id like an image to fade in as the page shows up. The tricky part (i think) is that you can't trace the load of a background image. So ive made a new image dynamically and traced that, assuming that once the image is loaded there, i can insert it to the background, and remove the loading icon (#loadingGal) code follows! (function($) { $.fn.pageOpening = function(path) { $("#loadingGal").show(); var imageObj = new Image(); $(imageObj).attr("src",path).load(function(){
[jQuery] support newbie: DOM & tablesorter questions. time sensitive
Hello jquery community, So I'm still wadding around jquery/dom/js but had to dive into the deep end to support under-resourced projects. I have a couple code questions and was also wondering what the best resource would be for on-the-fly question/answer sort of thing: irc channel(s)? I'm hoping that soon I'll be able to start answering questions instead of posting for basic solutions...but all in due time. 1. <li><label for="happy">Happy<input type="checkbox" /></li> - if checkbox (:checked),
[jQuery] Getting the xml string after a jquery ajax call
I am retrieving an xml file and using jquery to parse it, which is all working wonderfully. My problem is that I need to pass the same xml as a string on to some other parts of my system. I can't figure out how to get jquery to give me the string version, so I tried to change the dataType of the xmlhttprequest to text, save it in a var, and then have jquery parse it, but that isn't working either. What's the best way to have the xml as a string and as a properly parsed jquery DOM object? Thanks!
[jQuery] Add Class to matched href location
Im having trouble getting this to work, I feel like Im really close. Does anyone have any idea? var path = location.pathname.substring(1); if (a[@href == path]) { $('.nav ul#example li.addClass('active')); }
[jQuery] Checking if text input is fully entered
I'm writing an application whereby a barcode is scanned into a text field. This barcode becomes the benchmark and a new text field is inserted underneath. Every time a new barcode is scanned, it is compared to the benchmark and a message displays whether it matched it or not, and then another text field is inserted underneath. So potentially this application can process an infinite number of barcodes. The problem I have is that we want to make this application work without having to use the keyboard.
Next Page