Loading IFrame interferes with smooth animate
Does anybody know how to load an IFrame in the background of the browser, without interfering with running JQuery animations? I have this page that contains an IFrame. Using JQuery I set the src attribute to a certain url. But my page is also showing an animating span continuously. (kind of progress-bar). When the IFrame is loading a large image of the external url, the browser stops temporarily, until the images is loaded, so my animation is stopped for an instant, and then continues.
.animate() - setInterval
in http://api.jquery.com/animate/ i saw a comment: Just if anyone is interested: Animations are "rendered" using a setInterval with a time out of 13ms. This is quite fast! Chrome's fastest possible interval is about 10ms. All other browsers "sample" at about 20-30ms. in a follow up comment i found: I have dropped this value down to 50ms in my current project (by altering the hardcoded value in jQuery source); no noticeable impact on smoothness of the animation but the CPU usage has dropped massively!
Nav not working with jquery Scrollable... newbie
Subject says it all really..if you can fix this while maintaining the design, I will be forever grateful! I am at a loss.. www.sirtuesday.com/test/index.html Thankyou!
Adding an ID to each li in a ul
Hi Guys, I don´t understand my failure in this code. $().ready(function () { var n = $(".mainmenu li").length; $(".mainmenu li").each(function(n, element){$(element).attr("id", "link" + n);}); when the document is ready and javascript is enabled. I will count all li elements in the mainmenu ul. then I will add the id attrribute to each li so that my code looks like: before: <ul class="maimenu"> <li></li> <li></li> ... after: <ul class="maimenu"> <li id="link1"></li>
Using $.ajax(url) when url is a file://
My code uses the $.ajax(url) call to fetch a url. It generally works, but breaks on IE if the url is a (local) file:// url rather than an http:// url. The file:// url works just fine in firefox, but in IE the call does not succeed. Is the IE behavior a bug? If not, is there a proper jquery way to fetch a url that will work for both http: and file: urls, or do I need to implement the check to differentiate them myself? I'm enclosing the code that breaks (modulo choose-your-own-filename) <html>
Photoshop Style Multiply Blending Effect
Hello! Does anyone happen to know of a way using jquery or any other javascript to apply a blending effect to an image? I'm after something similar to the Photoshop blending mode "multiply". Ultimately, the goal is to be able to have any jpg, gif, or png with a specific class such as img.multiply "blend" as it does in photoshop. I know this might be a bit of a long shot, but does anyone know of a way to do this? Any help or ideas would be much appreciated. Thanks, Thomas
Limiting function called on load of subpage to the elements of this subpage.
Hi, I got a div on main page and on subpage, which load after a menu click. I want to edit a div on subpage load, but without altering div on the main page (both have same class and i want this function to be universal). This doesn't work, becouse after subpage load it also modifies div on the main page. $(function(){ $("div.a").html("yyy"); }); As for now i come up with this solution (but I think it doesn't look elegant): I added a flag (value attr) which tells if div was previously modified.
Development problems with Browser Cache
When I am developing using jQuery. It seems like I have to clear the browser cache for it to work with the latest changes. So if I make a small change and run the application, I have to clear the browser cache for it to load it again. I am using IE 8, but I have the same problem in FF and I am not sure how to clear the browser cache in FF? Is this normal? Is there a way to make it load it each time and not cache it? Thanks, Cory
animate accordion issues
I can't seem get the accordion below to use nothing but the default slide am I doing something wrong? $("#accordion").accordion({ animated: 'bounceslide', change: function (event, ui) { $(ui.oldContent).find(':checkbox').attr('checked', false); $('#accordion .bt').attr('disabled', true); } }); I even tried making seperate statements like $("#accordion").accordion({ animated: 'bounceslide') but no luck..doesn't perform the bounceslide or the fold I've tried as well jquery 1.4.2
[jQuery] Announce: jQuery copy plugin
we all know that in ie we can easily copy text to clipboard, but it is now so easy in fx. this plugin use a swf file to achieve this purpose. the swf file's default location is same to the plugin, if you move it to another location, change it in the plugin source code. more info:http://yangshuai.googlepages.com/jquerycopyplugin the code and the swf file are all from the internet, i just make it a jQuery plugin
$.post on unload event
Hey guys, I can't seem to get this working. Here's the only thing that actually does work: $(window).bind('beforeunload', function() { $.post('/ajax', { email: "<?= $u->get('email') ?>", program: "<?= PROGRAM ?>", module: "<?= MODULE ?>", page: "<?= PAGE ?>" }); }); BUT, I'd prefer not to use beforeunload as it doesn't seem to be supported everywhere. Using unload in .bind (or .unload itself) doesn't work. This is a shot in the dark, but would it work if I used $.ajax instead with async as false?
need to call jquery in head section after load
Hello, I have a webpage which allows the user to select the content they would like to display using ajax to do this. the problem i have is that one display option is a file tree which only works when loaded in the head section. the following code is loaded in the head section: $(document).ready( function() { // Hide all subfolders at startup $(".php-file-tree").find("UL").hide(); // Expand/collapse on click $(".pft-directory A").click( function() { $(this).parent().find("UL:first").slideToggle("medium");
legacy challenge - frames and doctypes in IE
I'm working on a legacy app which makes heavy use of frames. I'm attempting to create a new strict mode page inside the frameset but IE keeps using quirksmode. the frameset isn't defined with a dtd and i can't add one because the repercussions would be extensive. is it possible to have a strict frame inside of quirksmode frameset? my results indicate not. (apologies for lack of jquery, but this is the best place i could think of to ask this question)
JQuery xml url?
Hi all, I want to parse an xml file using jquery. Everything seems to be fine if the url of the xml file is at the same directory level of the html that processes it. Problem is that the xml is in a remote server. Here is the code I use: <script type="text/javascript"> $(document).ready(function(){ $.ajax({ type: "GET", url: "http://127.0.0.1/myxml.xml", //This would work: url: "myxml.xml", dataType: "xml", success: function(xml) { alert('It
Jquery works in IE/FF not in Chrome
Objective is to read from ticker.xml, parse, and set the html of headline1, headline2, headline3, etc. divs to the values of ticker.xml. This works great in IE 8 and FF but not in Chrome. Any thoughts? <script type="text/javascript"> $(document).ready(function() { $.ajax({ url: 'ticker.xml', type: 'GET', dataType: 'xml', timeout: 1000, error: function(xhr, status, error) { var err = eval("(" + xhr.responseText + ")"); alert(xhr); }, success: parseXml }); function parseXml(xml)
How to change text to input with jQuery? (and back)
Hello, I wonder how to let a small text snippet change to an input box with as value the small text snippet when you just clicked on. When you click out, or press enter, the new text has to have the value of the input? There is a list of data from the database. I would like an input box to appear when users click on a list item (text) and the input box has the value of the list item and users are ofcourse be able to change this value. The value has to be 'selected'. When users click back outside
Loading Jquery Scripts into a single page
Hey guys, I have two Jquery scripts , I need to load them into a single page The scripts work fine separately , but when I try to load them into single page, only one of them works this is my code for loading the two scripts: $(document).ready(function(){ //Load the second page and second page script $('#firstContainer').load('secondPage.html'); $.getScript("js/secondPageScript.js"); //Load the thirdpage and third page script $('#secondContainer').load('ThirdPage.html'); $.getScript("js/ThirdPage.js");
How do i check if a div is hidden or not???
if i have defined a div on my page <div class="Answer" style="display: none;"> then i wrote some jquery to make it shown or hidden now i want write jquery to do different things if based on whether the div is visible or not? How to check its visibility using jquery??? thanks in advance
Long calculation
I want to create long calculation form. What I mean? I have 2 text box (num1 and num2) for enter number, button (btnCalc1) for calculation and text box (res2) for result. <form name="calculus" action=""> <input type='text' name='num1' id='num1' /> <input type='text' name='num2' id='num2' /> <input type='button' name='btnCalc1' value='Calc' /> <input type='text' name='res2' /> </form> After I click button which calculate sum of numbers and show it in result
Need help adding checkbox/radio button values to an input for xml string!!!
Hi, I can't seem to get this working correctly. I have several radio buttons and checkboxes. Based on them being checked I need to add that value to an input (which will be hidden) to be passed as a form parameter. The input they are added to is wrapped in xml tags. Currently it is simply overwriting each value, not adding them to the string. One value "IKNTK" needs to be passed regardless. <script type="text/javascript"> $(function() { $(':radio,:checkbox').click(SetServices); });
Using .live event with jeditable
Hy there, I add some div's I want to edit with prepend to my list. But after adding them with prepend I can't edit them unless i refresh. I found out that I had to use the .live function for it but I dont know how to apply to jeditable. I have a method but I placed an event over an even and now I need to double click the first time or everytime I prepend something. The jeditable event $('.edit').editable('functions.php', { indicator : 'Opslaan...', tooltip : 'Klik
Increase value on submit
how can i increase a value when i submit a form. for example, lets use comments. there are 10 comments. and somewhere on the page there is a place that shows "10 Comments" when i submit a comment, that text will change to "11 comments". how do i do that? thank you!
image resizing script works in firefox but not chrome
I have this image resizing script: <!DOCTYPE html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> <script> $(document).ready(function() { $(".bbimg").each(function() { var width = $(this).width(); $(this).width(0); var maxwidth = $(this).closest("div").width(); if (width > maxwidth) { $(this).width(maxwidth-2).css("border", "1px solid #ef007c");
$(this) inside each()
Hi all, My code is something like this: selenium.browserbot.getCurrentWindow().$(selector).each(function() { var itm = $(this).closest("li").data("name"); ... ... ... } WHen i ran it, it complains that $(this) is a DOM element and therefore, does not have closest() method. I am confused here. I thought that $(this) will be a jQuery object instead of DOM element? Could anyone enlighten me? Many thanks, Sugi
Checkbox and Jquery - Checking
Hi, I'm trying to loop over a set of checkboxes (5 of them) and if at least one of them is checked and NOT disabled then do something Here is my code so far $('#btnSave').click(function() { var boxChecked = false; $('.aRow input').each( function() { if( this.checked && !$(this).attr("disabled","disabled") ){ var boxChecked = true; } }); alert(boxChecked);
Fade after Slide still Sliding
Hello all, Here's the situation: I'll slideUp a div, load some ajax, then slideDown the result. In the result, there are two more divs (navigation and 'subcontent' containers) I have links in the navigation div that should fadeIn new content (via ajax) into the subcontent container. Now, the fadeIn fadeOut functions operate correctly _until_ I use a slide on the larger div. If I slide at all, everything turns into a slide, even within the subcontainers. I'm not sure what's going on. Here's an example
binding click event to specific cell in all rows of a table
Hello, in a table I want to have a specific click event (calling a function) for the first cell of each row and another function call e.g. for the third table cell. I assigned different class names to these cells and used this script: $("#tab_kat tr").find(".firstCell").bind("click", function() { ... }); And the same for ".thirdCell". But is this possible without assigning class names to reduce the size of the code? Something like that: $("#tab_kat tr td.cells[1]").bind("click", function() { ...
document ready function if checked
The code below is working like it should. I need to change the first rule so it checks first if it is checked and then continuous. <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { $('table#pl td#cnc').hide(); $('#hide_cnc').click(function() { if ($(this).attr('checked')) { $('table#pl
Loop only top level of li list
Have a ul with x number of li's containing links (a). Some of those li's have nested ul/li sets, and so on. I want the .each to loop only through the top level li's of the parent ul to modify the a.href. Currently it loops though all and finds each a.href all the way down. using $("ul#classname li a").each but only want the a's in the top level li's. I may just be having a brainfreeze...
.children([selector]) doesn't work?
I want to retrieve all of a given class within a jQuery object that already exists but when I give the children() method a selector it never returns anything. If I leave it blank it returns the imediate children but I can't get it to do anything else. http://api.jquery.com/children/ When I searched for the children function in the jQuery code it looks like it is only desinged to give the imediat children children: function(elem){return jQuery.sibling(elem.firstChild);} What am I missing here?
Remove string before the - character
Hi, I am trying to split out a string. E.G "Australia - VIC". I want to remove everything before the -. The line of code I am using to do this is: var state = optionText.replace(/.* \- /,""); This works in IE7, but in all other browsers is only removing the - resulting in "Australia VIC" rather than the desired "VIC" Please help!
NO_MODIFICATION_ALLOWED_ERR in Safari using xhtml with a $.get() request
When using a valid website served as application/xhtml+xml and requesting content using $.get() Safari/Chrome will throw the following error (referring to the development version of 1.4.2 of jquery): NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7: An attempt was made to modify an object where modifications are not allowed. – jquery.1.4.2.js:4448 4448 is part of jQuery.extend({}), line 4447/4448 are the following: // Go to html and back, then peel off extra wrappers div.innerHTML = wrap[1] + elem +
Drag n drop on iframe
Hi, I am developing an application where user can drag an image from group of images and drop it on one web page. I am opening this web page in iframe. My problem is that i need information about the underlaying HTMl element details where image is droped. HTML element can be anything, it can be "DIV, textbox, table and so on .....". Please give me any idea of how to achive this ......
Ask : Why does the bind/shorthand method of keyboard event , always occured warning ?
Hai all masters and members here , im new bie here . may i ask something ? Why does the keyboard event : keyup , keypress , keydown on bind/shorthand method of it , always occured warning ? im using jQuery 1.4.2 and the warning on my firefox error console is like this : " The 'charCode' property of a keyup event should not be used. This value is meaningless " and here is my code : ----------------------------------------------------------------------- jQuery(document).ready( function(){
Float property interfering with .toggle .fadeOut
This is my first post and I'm a beginning developer. If I apply a float property to <a> elements contained in a <div> that I want to toggle to hide and show when the <h2> is clicked, the element will show but will not hide again. When the float property is removed, it functions as intended. Thanks in advance, the meat of the code follows. The jQuery; $(document).ready(function( ) { $('.chapter').hide(); $('#main h2').toggle( function() { $(this).next('.chapter').fadeIn();
How to enabke/disable button base on checkbox?
I have a table there are checkbox in all rows, then I have a button in disabled. I hope the button will be enabled if one of checkbox is checked, button should be disabled if no any checkbox is checked, what can I do?
google.load function doesn't work if called from jquery ready function?
I'm using the Google AJAX APIs, but some reason google.load works when run through normal javascript, but if I call the method from my jquery ready function it doesn't work. Code and output is below, any help would be greatly appreciated! page.html <script type="text/javascript"> loadGoogleStuff(); function loaded() { console.debug("in loaded function"); } function loadGoogleStuff() { console.debug("before google load code"); google.load("feeds", "1"); console.debug("after google
Problem with Postback
Hi! I have this script: $(document).ready(function getFocus(){ $("input.GarClaCheckBox").click(function() { var idchek = $(this).attr("id"); idParam = $("td.GarClaParam2 > input").attr("id"); if(idchek!=null) { var chr = idchek.charAt(3); var chr1 = idchek.charAt(4); idParam = idParam.substring(0, 3) + chr + idParam.substring(3+1); idParam = idParam.substring(0, 4) + chr1 + idParam.substring(4+1); $("td.GarClaParam2 > input[id =" + idParam + "]").focus(); } //$("td.GarClaParam2 > input[id =" + idParam
How to keep object at bottom
I know css has a property position: fixed, but it's not work on IE6 how to keep a sqaure box width 100px and height 100px always stay at right bottom with 10px margin?
How to align tabs?
Hello. I'm not very good at javascript and neither at CSS, and I have been trying to make some tabs align to the center. Is there any way possible to do this? I have been checking the CSS and so far I haven't found a way to align the tabs to the center. I want something like this TAB1| TAB2| TAB3| TAB4 TAB 1 TEXT TAB 1 TEXT TAB1 TEXT TAB1 TEXT TAB 1 TEXT TAB 1 TEXT TAB1 TEXT TAB1 TEXT TAB 1 TEXT TAB 1 TEXT TAB1 TEXT TAB1 TEXT TAB 1 TEXT TAB 1 TEXT TAB1 TEXT TAB1 TEXT TAB 1 TEXT TAB 1 TEXT TAB1
Next Page