Collapse a column if nothing inside it?
should I do it like this? CSS 20% 60% 20% content col1 col2 col3 use jQuery to check if col1, col3 has content. if none, remove/hide them, set col2 to 100% or is there a better approach?
Form submit issues with boths last versions (1.3x and 1.4x)
I am not sure if this is a bug or wanted behaviour: if you have a definition like: $(function(){ $('#filter_form').live('submit',function(){ alert('submit'); return false; }); }) than a form like: <form id="filter_form" name="tasks_filter" method="post" action="#tasks_list" enctype="text/plain" dir="" onsubmit="alert('asaaa');return false;"> at the end of the form (/form) put another script: $(function(){ $('#filter_form').submit(); }); the live event alert will be triggered AFTER the actual form
[solved] .hover() & .animate() on <li> bug
First of all, props to the jQuery team for updating the framework, documentation, and forum. It's even more amazing now! :) I'm fairly new to jQuery so I figured you guys might be able to help with a beginners level problem. I'm sure this isn't a bug in jQuery. It's most likely an error on my part. I'm building a nav with some jQuery effects. I got the hover to work like i want it, as well as the custom animation. However, there are two small bugs that I cant get ride of. First bug is when you
Animate only working in IE
This sure has me puzzled since it's usually the other way around. The script below, straight from a book, works in IE, but not in FF, Chrome, or Safari. Can anyone tell me what I'm not doing that would work in the Good browsers <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <style> div { background-color:cyan; width:100px; border:1px solid blue; } </style> </head> <body> <script type="text/javascript">
Form is not Submitting except in Firefox
I have the following code: $('input#submit').click(function() { //check if compulsory forms are filled if ( //checks if forms are filled) { alert("You need to fill all the required fields before Submiting");
Superfish - Joomla - Horizontal Spacer doesn't work
Hello. I just setup Joomla and Superfish. After mucking around with the CSS to make it look the way I would like, everything is good to go but one thing. There is a box in the Joomla module for "Spacer for Horizontal menu". No matter what I enter in this box, nothing ever shows up. Any ideas?
Help me combine multiple XHRs into one!
Hello, Currently I am using the following code in order to update two separate divs on my page. However I would like to combine them so when the first call executes, the PHP page will return the result for both portions and then the javascript can parse and update the two divs. Is this possible? $("div#mainconsole").append("<div class=\"cmd\">>> " + input.value + "</div>"); var inputval = input.value; input.value = ""; $.ajax({ type:
Automating a slideshow and stopping it with a click.
Hello, I have a Portfolio section of a website I'm working on. I have the page for the most part working perfectly. I wanted to add one more effect to it. I wanted to page to run in a slideshow automatically for 5 seconds on each picture and continue to loop until someone clicks on a thumbnail below which would stop the slideshow and display the larger picture of what they clicked on. If you take a look at the page this might make more sense. http://www.mycloud.me/debord/kitchens.html This
SelectBox reload itself with new data.
Hi Im trying to reload selectBox with new “options” when somebody chose one of items in this same selectBox But it's work only for first time. I seams like is not call function .change(function ()... for new reloaded selectBox There is my javascript source http://pastebin.com/m38be41d6 Do you have any idea what is wrong? Thank you;)
How to bind browser event?
Hi everybody, i need to know how i can bind browser event for: Don't show previous insert when i click two times inside input box; Don't show title when i place mouse over input box. I successfully bind context menu with: $(document).bind("contextmenu",function(e){ return false; }); Browser: Firefox 3.5 Thanks a lot!
Unfocused data entry using scanner
Not sure where to get started with this (and I'm a jQuery beginner). Would appreciate pointers on how to start or even what terms would be good for searching out answer/examples/... I'd like to use a barcode scanner to grab an ISBN number for a book and a barcode number. The values are straightforward to differentiate using regular expressions. When scanning a number with the web page or a field as the focus, I'd like to grab the value, test it for what type of value it is and then add it to the
Callback not invoked with JSON response in 1.4.1
Hi - I've been hitting a strange bug where callbacks are not invoked when a JSON response is returned from an AJAX call under jQuery 1.4.1. I just upgraded my app; this was working perfectly pre-1.4. I do specify the return type as "json" when I invoke $.post . When a simple JSON string like "false" is returned, the callback is invoked. It seems to fail with more complex types, specifically with JSON objects, i.e., {"a":1, "b":5} . If it helps, I'm running Firefox 3.5 on Ubuntu. In my test environment,
fadeOut jump
When I fade something out the items below it jump up, then jump down again whenI fade it back in. Is there a way to maintain the space so the items below don't move?
JQuery load function and Ajax
Hi jquery Men, I created a page (index.html, including the embedded javascript) with a div loaded by an external html content. But in this new content the click function I defined in the index.html page does not work in the new content. Then my question is: do i need to include all javascript in the external html content ? Thx for your answers.
stop() on a fading element don't work
Hello, I can't manage to stop an animation with stop() function. Here's the code: $('#test').mouseenter(function(){ $('#test .navigation').stop().fadeTo('normal',1); }); $('#test').mouseleave(function(){ $('#test .navigation').stop().fadeTo('normal',0); }); I don't know what's the problem, perhaps I'm not understanding stop(). Thanks in advance.
Json on Jquery 1.4
JSON in jQuery 1.4 and 1.4.1 not working TEST IN --> $.post(....,'json')
When to use setter methods?
Hi, I am a little confused about when to use setter methods. For example, I have this code $("input[placeholder]").val($("input[placeholder]").attr("placeholder")); should this be used like this $("input[placeholder]").val(function(i, value) { return $("input[placeholder]").attr("placeholder"); }); I think a better question is when to use the .each loop? Since, the first line of code I have works fine. Thanks for your help.
Different CSS per domain?
Looking to set up a website which will have several different domains pointing to the same pages - different personalised branding but same content. I'd like to load a different set of style sheets based on which domain they visited the page via, and allow this setting to be remembered in a session cookie so each page they visit will continue with the same personalised style. Had a good look around, and seen a few style switchers, but nothing which bases the switch on the domain. Anyone able to point
Continuing ongoing animation?
Hi, I've this little slider thing or whatever you want to call it, the thing is that it stops between every animation. I want it to keep going if you click more times. Basiclly making the ongoing animation continue. I was thinking about having some sort of timer that runs as long as the animation and if you click again during that time it will continue scrolling. In c# I could modify running processes and I was thinking it could work here too. http://jarilindqvist.se/mario/ The code for the animation
firebug jQuery internal error
I'm running a small jquery program, but before the browser even gets to it, the firebug console throws this error: a.call is not a function When I click on that I get this, which looks like jQuery itself is throwing the error. Is this just a firebug anomaly? /packer/ JS compressor detected /* !eval(new String(function(p,a,c,k,e,r);)) */ /* 2 * jQuery 1.2.6 - New Wave Javascript 3 * 4 * Copyright (c) 2008 John Resig (jquery.com)
Reattach event to an element
I'm trying to develop a search box overlabel feature working off of the example provided in Learning jQuery. I have everything working great except for one problem, it breaks when I switch out the content using ajax. I'm using CGI::Ajax for my ajax functionality and I have my page laid out as follows <ajax return div> <results table> <search box> <pagination controls> </div> When a user pages, the ajax fires, the entire div is swapped out and the results table updates. Obviously when do that, my
Select two unique elements by ID
For some reason this answer has eluded me for a while now... Let's say you have two elements, and you know their IDs; is there a way to select them both at the same time; something like $('#test #test2')? I realize I could just select them both on two different lines and apply the same function, or use class or something to track them down; but sometimes I just want to grab two elements by ID and do the same thing to them. I assume I'm just missing the syntax.
hide() and show() on z-index
Hi people, I'm having a problem on: http://skydive.uproductions.nl/ I've got a menu on z-index:0; and a footer on z-index:1; if you're doing a mouse over, the menu pops up under the footer. But the menu is longer than the footer (it's a png image) so you see the menu stock under it what isn't exactly the meaning. if there was a overflow-bottom:hidden; it's was solved but now i don't know what to do! someone having a good idea? Thanks in advance daan
Loop through JSON string
Hello Friends, I've the following JSON string generated with random Name and Location: {"Super" : [{"Name" : "UOBRSVTG","Location" : "WADTXVBAAL"},{"Name" : "WMWYIOLD","Location" : "DVVRGSEQBS"},{"Name" : "QZLOPGCW","Location" : "TISSQSJQRA"},{"Name" : "ZVGNGPRX","Location" : "LETLPHUJKA"},{"Name" : "AIXPVLVC","Location" : "KKFCHQAEQF"},{"Name" : "LDTWWSVY","Location" : "DHSLYHHJPI"},{"Name" : "DJAURDEH","Location" : "SIWDKLQOXH"},{"Name" : "GEMEUXIO","Location" : "JZMXUYBRAH"},{"Name"
$.load stops processing the scripts in a html page after a while
Hello, I have a problem when loading a section of a page via $('...').load. The section I need to load contains a simple div with some content followed by a <script></script> tag width some JS code. The script works fine the first few tries... but after the 4-5th time the loaded script is not processed anymore. The funny thing is that if the section I need to load is bigger that 512B then the loaded script is always processed successfully. I have no clue what the problem can be. Can anyone help me?
Hiding empty span
I'm using the following css code which wrapped around a dynamically populated field; <span class="ui-widget-header platform ui-corner-all"></span> When the span is empty I want to hide it, and I've used this jquery to do this. <script type="text/javascript"> jQuery(document).ready(function() { $(".platform").each(function(){ if($.trim($(".platform").html()).length==0) $(".platform").remove(); } }) </script> However, the ui-widget-header class appears to be stopping it from hiding - if I remove
Combobox dropdown list disappears
I am trying to use the code below to create the following behavior for comboboxes with class = "requiredCombo" - 1. If the selected index is 0, I want the font to be grey; otherwise black. 2. When the mouse enters the box, I want to change the font to black while the user is making a selection. 3. If the mouse leaves the combo and the user did not click (that is, they just ran the mouse over the combobox) and the selected index is 0, I want the font to be grey otherwise black. 4. If the user clicks
Starting a second animation stops the first one?
Hello, I have some links on my page with ajax calls, and the callback animates the links. My problem is, if I quickly click on two of them, the first one will begin to animate (ajax will complete successfully), and then when I click on the second one, the first one will stop animating, and only the second one will finish. Is this normal behavior? // document.ready /* behavior for add to cart button */ $('a.item-addCart').live('click', function() { addToCart($(this)); } ); function addToCart(button){
Select / Dropdown - Are you sure confirmation confirmation
I was wondering if someone could help me with this code, I have tried all kinds of things, but can not get the result I want. As part of my internal application I have a select / dropdown list. Which looks something like this. <select class='bActions'> <option>ACTIONS</option> <option value='http://mydomain/edit_page'>edit</option> <option value='http://mydomain/delete_page' class='confirm_delete'>delete</option> </select> Also I have $('.bActions').change(function() { window.location = $(this).val();
Scrolling main document after iframe has finished loading
Hi all, I've got a tricky problem I have a long (more that one screen) document, which has a iframe in the bottom. The iframe target URL contains a "bookmark" (hash mark) to scroll the iframe contents, like this: <iframe src="document.html#bookmark"></iframe>The problem with this is that the main document also scrolls down to show the bookmark in the iframe! So I tried to solve this with a little jQuery in the main document, but I can't get it to work as it should: $('iframe').ready(function () {
jQuery 1.3.2 and IE6
Hi, I´m using jQuery 1.3.2 and get a error when I run my Code in IE6. The error points me to line 3517 of the jQuery-File. It seems, that the "xhr.open(type, s.url, s.async);" causes the problem. IE error is: "Unknown name". When I use the actual version of jQuery it just changes the linenumber, but has the same error. Any ideas? regards Dirk
How to use jquery with Jsp or Servlet page
Hi, please help me i have a requirement How to use jquery with Jsp or Servlet page
need help with gallery
hello people :) i am an absolute beginner and i hope i dont post this in the wrong forum... if so, move or delete it :) were learning jquery at school and i started to create my own website using it. i know that ive done it in a very circuitous way, but it works... first, heres the website: http://sicgraphix.kilu.de/V01_3/site.html (yet on a free hoster) the question i have is, how could improve my gallery script? i dont want to use existing galleries, but the way gallerific works looks really nice
How do I access json data outside of $.getJSON() ?
function get_something(){ $.getJSON("get_something.php",function(json){ console.log(json.something); }); } How would I use the value of json.something outside of the get_something(); function?
Problem with event delegation
Hey, I'm having a problem with something I asked about before on the previous jquery google group. This code isn't working: <$("#sharepg").click(function(event) { var $tgt = $(event.target); if ($tgt.is("#expbm")) { return false; } if($(this).find("#expbm").is(':hidden'))//if quick menu isn't visible { $(this).animate( //show menu on click { width: "162px"
Problem with click() for image viewer
Hello, So I'm trying to create this product viewer where you have a thumbnail of the product and when you rollover the image, an icon appears at the top left corner of the image and when you click this icon i want to open i bigger using the fancybox plugin. My problem is that I cannot click the zoom icon when it appears and put an event to it for when you click, here is my code: var $state=0; //check if the icon is already displayed to so we don't overlap 20 of them. $("div.product_img").hover(
Confused about .index()
From the documentation, here's an example of using index(): $("div").click(function () { var index = $("div").index(this); $("span").text("That was div index #" + index); }); I don't understand why we must duplicate the selector. Why can't we replace the third line of code with the following?: var index = $(this).index(this); I.e, why can't we use $(this)? What does the difference between the selector before .index and its argument? Can I specify something different in place of the second $("div"),
Why button still fires
I have the following code attached to a Save button on my form: $('#btnSave').click(function() { $('input[type="text"].requiredText').each(function(){ if (this.value == '' || this.value == 'Required'){ $('#lblUserMessage').text('You must enter all Required items.'); $('#lblUserMessage').css({'color':'red', 'font-size':'125%'}); jqDialog.notify("<BR />You must enter all REQUIRED items.<BR />Please
Apply 50% opacity to a div
Hello, I was trying to apply an alpha of 50% to a div but using opacity with CSS but it is not validated in CSS 2.1. Can I apply some opacity to a div using JQuery? Thanks, Miguel
AJAX retrive attribute value from loaded content
I load data to a div dynamically $.get(test.php, { cmd: cmd, id: id},function(data){$('#files '').html(data);}); The retrieved data is in a table and looks like this test.php <table class="files_table"> <tr eID='1'> <td> Content # 1</td> </tr> <tr eID='2'> <td> Content # 2</td> </tr> </table> Now I wan't to be able to by clicking on my div to retrive the selected 'eID' attribute. I have something like that on my parent site where my div "files" is placed $('#files
Next Page