No flash plugin? Load an image!
Can anyone show me how to detect if the user has the flash plugin installed and in case they don't it will load a jpg instead.
Noob event question
What 's the difference with: $('div').click(function(){ //do this }); with this one $('div').bind('click', function(){ //do this }); Aren't they the same?
[jQuery] warning: jquery in firefox 3
hello everyone, i just want to ask anybody about this warning that always show whenever my page load with the jquery.js file. Warning: test for equality (==) mistyped as assignment (=)? Source File: http://localhost:2008/jquery.js Line: 1161, Column: 32 Source Code: while ( elem = second[ i++ ] ) anonymous function does not always return a value Source File: http://localhost:2008/jquery.js Line: 1859, Column: 71 Source Code: }); anonymous function does not always return a value Source File: http://localhost:2008/jquery.js
[jQuery] can not append <a> to body in IE
Hi guys, you can see jQuery code below, it works in Firefox and Opera for me, but does not work in IE6. $(function() { var a = $('<a>').attr('href', 'javascript://').append('test'); $('body').append(a); });
[jQuery] Making the accordian menu sticky
Has anyone found a way to make the accordian menu sticky? As in it doesn't close up and refresh itself everytime I visit a link? Thanks.
[jQuery] After refresh $(document).ready shows different value for select from change
The following two are giving different results: $("#service_select").change(function() { alert($("#service_select").val()); } $(document).ready(function() { if ($("#service_select option:selected")) { alert($("#service_select").val()); } } Onchange I get the option value. On document ready I get the text. So when I choose something from the select element I get 2,3,4 etc. But on reload I get 'Alpha', 'Beta', 'Gamma' etc.. This is happening in both IE and Firefox. I want to trigger events based upon
[jQuery] How does clone() work?
I'm having the worst time working with clone(). It returns an object...still can't access it. What I'm doing is looping through a list of divs (same class) and trying to clone each one. I want to clone them so that I can reorder them. var html; // in the loop html += $('#myDiv-' + id).clone(); Is what I think should work...but I just get objects. Any tips here on this one? Thanks -- View this message in context: http://www.nabble.com/How-does-clone%28%29-work--tp20731606s27240p20731606.html Sent
[jQuery] jQuery timing out on page load
Hi, I've got jQuery loading by default on my site. The library is only used on some pages in my site, however when I load a page that isn't using jquery (but still loading the file in the html header) Firefox pops up with a warning that jquery is timing out. Any suggestions? Cheers
[jQuery] Lightbox/ThickBox/ui.dialog etc
Hi there, Does anyone have an opinion on what they think is the best lightbox implementation to use? It's not going to be used to display images, it's mainly form interaction. My only caveat's are: - Must be draggable - Must (unfortunately) work in IE6 - Must be modal I've been playing with ui.dialog and really like it. However I seem to be having some issues in IE6 - using the same theme as displayed on this page: http://dev.jquery.com/view/trunk/ui/demos/functional/#ui.dialog The "close" image
[jQuery] how to call a function at outside object in jQuery's click function?
I met a small problem that an outside 'example' object does not be got in a 'click' function. would you tell me how to do that? == example code: == var Example = function(){}; Example.prototype = { i_want_to_call_this_function: function(){ alert('Hi!'); }, execute: function(){ $('#any_button').click(function(){ // How to call 'i_want_to_call_this_function' from here? // this.i_want_to_call_this_function(); // -> Unknown. i know a 'this' object pointed to html object. }); } }; var example = new Example();
[jQuery] Using fade on .toggleClass
Hi all, I'm trying to make something fade in and out when I use "toggleClass" to show and hide. I've been looking around for a while and can't see if it's possible. Here is my code: $(function() { $("#topArea ul#profileLinks li.userEmail form#signInForm").addClass("hide"); $("#topArea ul#profileLinks li.userEmail strong").hover(function(){ $(this).addClass('hover'); }, function() { $(this).removeClass('hover'); $("#topArea ul#profileLinks li.userEmail strong").click(function(){
[jQuery] Flow control in functions.....
I may have titled this wrong but that is the best description I could think of being a newbie. I have a function the inside calls another function. What I need to have happen is for the calling function to wait for a response from the called function but that is not what is happening. The calling function goes right on processing the rest of the script which of course errors out because the required vars are not set properly yet. Here is some code.... var chkmail = function(data){ if (data.exists
[jQuery] Draggable() doesn't work with table rows?
I can drag and sort lists. I can sort tables. I can drag entire tables. But I can't drag individual table rows. Anyone know how to do it? Here's some sandbox code: <ul id="list"> <li id="a_1" class="drag1">The</li> <li id="a_2" class="drag1">slow</li> <li id="a_3" class="drag1">green</li> <li id="a_4" class="drag1">turtle</li> </ul> <table id="table"> <tbody id="rows"> <tr id="a_1" class="drag2"><td>The</td></tr> <tr id="a_2" class="drag2"><td>quick</td></tr> <tr id="a_3" class="drag2"><td>brown</td></tr>
[jQuery] [validate] remote checking and apache rewrite problem
Hi i have a problem with "remote" checking. I have two identical scripts, both of them return 'true' or 'false': 1. /something.php 2. /script/something When i use the first PHP script in "remote", javascript sends data to the PHP script and PHP sends data to javascript. Everything is working OK. But when i use the second PHP script in "remote", which is executed the same way as the first, but the difference is, that this second script is handled through Apache's rewrite function, this second script
[jQuery] Jeditable, async value
I'm using the fantastic Jeditable plugin, everything is great, but there is one problem that I can't solve. I submit the edited value to a function called setTitle (successHandler, errorHandler, value) which sends the data to the server and if everything goes well (the server responses) it calls the successHandler If the server responses I wanna set the title to the new value else I'd like to use the old value $(".title").editable(function(value, settings) { setTitle(function() { //
[jQuery] [Tooltip]
I'm using the tooltip-plugin from Jörn Zaefferer and it's really cool. Until today it had everything i needed, but now i need some functionality where the tooltip itself is hoverable, so i'm able to click the links in it for example like on this page:http:// www.cssplay.co.uk/menu/balloons.html In this example the tooltip hides, when the mouse does not enter the tooltip and leaves the object, or when the mouse enters the tooltip and leaves it again. Would it be possible to achieve this with another
[jQuery] Strange behaviour with sortable()
(Disclaimer: Sorry for posting code -- It's as terse as I can make it.) I'm trying to enable sorting between tables -- drag a row within a table to change its order, or drag a row to another table and it will "snap" into place. In each case, after you drag-and-drop the row, the table calls an update function. Now, if I set up the .sortable() for each table manually, sorting works fine. Each table callsback to its update function and reflects the current rows. E.g.,: ------------ <b>Table 1</b> <table
[jQuery] Combining Selectables and Draggables
I wrote up an article doing my best to explain how to use both selecable and draggable UI elements to work together to select a group and to drag them. I Richard. Worth helped me about a year ago to try to figure it out, but it was kind of buggy, then I asked him if he found a solution, so I decided to write an article about it and share it since I know I am not that only one who wants to know how to do this. Link: http://www.ryancoughlin.com/2008/11/23/combining-selectables-and-draggables-using-jquery-ui/
[jQuery] Auto Save After Every Field Change?
I'm thinking about adding the functionality to auto save the user's data using ajax calls after each time he leaves a field and has changed the data in it, but my concern is about the amount of traffic and calls this will generate between the browser and the web server. Should I be concerned about this type thing of this in this day and age? Overall, there aren't many fields - less than 50, but I can end up with multiple rows of data within it, ex a list of names with their related address, street,
reload every few seconds, IE problem
I wan't to display content from php file that changes every few seconds. I got it working in FF 3, Chrome, Opera 9.62, Safari 3.2 And IE 8 doesn't work With this piece of code <head> <script src="templates/common/js/jquery.js"></script> <script> $(document).ready(function() { var refreshId = setInterval(function() { $('#timeval').load('ajaxTime.php?randval='+ Math.random()); }, 1000); }); </script> <title>Otvoreni radio</title> </head> <body> <tr> <td class="otvoreni"><a
Combining selectors
Is there a way to combine selectors? My code is getting pretty messy when it's all really just the same thing. //These all do the same thing, only the selector changes //Is there a way to make it cleaner by combining them all? $('#mploader_women1 a').fancybox({'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': true}); $('#mploader_women2 a').fancybox({'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': true}); $('#mploader_women3 a').fancybox({'zoomSpeedIn': 300, 'zoomSpeedOut':
[jQuery] Validation
hi, I'm using the jQuery Validation plugin for a big project and I'm loving it. I am however getting desperate trying to solve a particular issue. I've hunted for a solution for days now and tried everything I could think of, but it seems I coded myself into a deadlock. I'm hoping you can have a quick look at my code, it's only a little bit :) I'm developing a user registration form with quite some advanced validation. So far it works just fine, apart from one thing: remotely checking if the username
[jQuery] Why keyCode into keyup event is disable
I'm trying to use the folowing code <!-- ------------------- HTML botom of the page -------------------- --> <script>initform()</script> /******* Javascript *******/ function initform() { // To find every input field into myform and attach mykeyupfct $("input[@type='password']:visible,input [@type='text']:visible").attr("id",function(){ $(this).keyup(function() {mykeyupfct(this);}); }) } function mykeyupfct(myfield) { var sid="#"+myfield.id var skey $(sid).keyup(function(e) { skey = e.charCode ?
[jQuery] How to pass loop increment to Jquery
Hi, I've my PHP code generating rows using certain loop conditons, And I'd like to show/hide a div overlay on mouseover and mouseout of a text link generated in each row respectively. I wrote the following code. this seems to be show div overlay of last row. That is because I wrote the function in document.ready. I dont think Jquery lets us put javascript in HTML code, So how can I make my code work in such a case? $(document).ready(function(){ var i= $("#count").val(); for(j=0;j<i;j++){
[jQuery] error option for jQuery.ajax
Hi, I have the following code below where I'm trying to dynamically check if an AJAX request error occurs. If an error occurs, do something; otherwise, do something else (if it's a success). But according to jQuery.com, they say "You can never have both an error and a success callback with a request." And that's why I'm getting an error when running the code below. Is there a way to solve this? $(document).ready(function() { $.ajax({ type: "GET", url: "SomeProcessPage.cfm", data:
[jQuery] remove objects from set
Hi! Using hints from this group, I create set of invalid fields this way: jQuery.fn.push = function( selector_or_nodes ) { // Given a selector or a jQuery object, append all of the nodes to // the current jQuery object. var nodes = (typeof a == 'string') ? $( selector_or_nodes ) : selector_or_nodes; var node_count = nodes.length; for( var i = 0; i < node_count; i++ ) {
[jQuery] Drop-down code broken
Hello, I'm pretty new to jQuery and found a nice drop-down menu on the web I'd like to use. However, the code for the drop-down effect doesn't seem to work, and I believe it's because the jQuery library they use is from 2006. Here is the old code: <script type="text/javascript"> $(document).ready(function(){ $("#nav-one li").hover( function(){ $("ul", this).fadeIn("fast"); }, function() { } ); if (document.all) { $("#nav-one
[jQuery] Disable/Enable jQuery Added Events
Something I would like to do is to add several events handlers to an element and control the firing by enabling & disabling it. For example: jQuery(".sample").click(function() { // do something }).disable(); Clicking should not fire the event until jQuery(".sample").enable() has been called. Have anyone done something similar?
[jQuery] Why does :not([id=blah]) not work?
Hi there, I'm just starting to explore using jQuery. Like it so far, but I'm totally thrown by this. On a page, I'm trying to hide all images in a set except the first one. Then, when you click on a menu link, another should fade in, and all others fade out. The second part works - when you click on a link tag, the image w/ the ID listed as the href of the link fades in, and any others that are visible fade out. I'm using this: $("#central img:not([id=href])").fadeOut("slow"); So I copied that syntax
jQuery basics
I'm a first time jQuery user and I'd like to confirm that I understood correctly some of the basics. My assumptions: * With the default settings and no other libraries around, jQuery() and $() are synonyms. I can freely swap them in code examples. * The ready() event can't be assigned to anything else than jQuery(document). I cannot do something like jQuery("ul#menu").ready() to enable my drop-down menu as soon as it's loaded. * jQuery(document).ready(myFunc) and jQuery(myFunc) are synonyms. Is this
[jQuery] Selecting elements based on exact content
Hi all The :contains(text) selector will select any element that contains the specified text (similar to a like '%stuff%' database query). How can I find only exact matches? i.e. if I'm searching for 'ants', to find only elements containing the text 'ants', and not elements containing the text 'pants' or 'antsy'? Thanks David
[jQuery] disable header breaks tablesort
Hi, i have a table col1 | col2 | col3 I don't want col2 to be sortable... So I added $("#tblusers").tablesorter({ headers: { 1: { sorter: false } } }); Now, the column is not sortable as I wish, but it breaks the other 2 columns. I can click on the other 2 columns only once each. It sorts them correctly, in descending order, but then won't let me sort ascending. The only way header1 will respond again is if i click column 3 (which again is locked on descending).. Can anybody help? Thanks -- View
[jQuery] can't get an attribute from an appended <img>
hi, this is my first post on the group so, i have a form through wich i'm sending an ajax reques to a php script and get the result back. to be more clear i write a text into an input box then i submit it to a php file where I make an image from the text using gd2. Then I send back the path to the image. I use this path so i can add images to a div. add the images to the div i'm using append(). The ids of the images are dynamicly made. all ok until this point what I want to do is, when I clikc an
[jQuery] [jCarousel] Question about weird autoscrolling
Hello everyone, I am using jcaousel autoscoll autoscrolling based on this example: http://sorgalla.com/projects/jcarousel/examples/static_auto.html. In stead of pictures I am using just plain text: <div style="padding-bottom:10px"> <ul id="mycarousel" class ="jcarousel-skin-tango"> <li> <p class="kopKlein" style="width:120px">Artikel 1 <p class="tekstVak" style="width:120px"> <b>Lees alles over onze nieuwe content rotator</b> <a href="http://mbalance/news/news_item/7">read
[jQuery] registering a callback on an jcarousel image
Hey guys, I have the following code to to something, when an image in the carousel gets clicked: $(document).ready(function(){ jQuery('#mycarousel').jcarousel({ itemLoadCallback: mycarousel_itemLoadCallback, initCallback: test }); }); function test (a, b) { $('li.jcarousel-item img').click(function () { console.log("dit it"); }); } But unfortunately nothing gets logged to the Firebug console, so nothing happens when I click an image. What am I doing wrong here? Regards, Samy
[jQuery] trying to act on certain DIV's and not others
Hi folks, apologies if this is a completely noob question. I wish to close (hide) and number of <div>'s whilst leaving others open. I considered the possibility that it might be feasible in Jquery to act on div's with a certain pattern in the id name. Not sure if this is true tho; for example <div id-="contact_blah"> <div id="contact_yak"> <div id="nothanks"> so that the first two div's would be subject to being hidden, and the third left alone. I wish essentially to have a series of links toggle
[jQuery] superfish + bgiframe problem on IE6
Hi there, Well sorry if I'm asking a question that's been answered a lot already, but I just can't seem to get it working for me on IE6. I was recently involved in building the UI for www dot geotrust dot com ., but I can't get the bgiframe to work on IE6 on pages where the menu drops down over (or under) a select element. Was wondering if anyone could maybe have a look and give some insight into what I can do to fix it. the page in question is here: www dot geotrust dot com /about/contact/ support-form/index.html
[jQuery] [validate]
Hello i have a question about the "remote" checking. My question is: does the "remote" method need the php script to have .php in its name ? (i.e.: something.php) In other words, does "remote" method work with Apache's Rewrite function? I have two identical scripts which both return TRUE or FALSE to jquery. Scripts: remote: "/somedir/something.php" - it works (jquery sends data and receives TRUE or FALSE correctly) remote: "/rewritedir/something" - doesn't work (jquery sends data and doesnt receive
[jQuery] trying to style thickbox
hi there im trying to style thickbox so it looks a little better howerev im lost. i have seen some places on the web where its styled real nice but i cant see how it is done can anyone offer me pointers ? one example is on biocompare.com (click signin or register!) tnx sean -- View this message in context: http://www.nabble.com/trying-to-style-thickbox-tp20716471s27240p20716471.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Can't get appropriate elements from server response.
Here is JS my code where I intend to get 2 DIVs and use there content. $.post( someAction, $.param(outData), onUpdatePostSuccess ); function onUpdatePostSuccess(data) { alert(data); var newTitleHTML = $("#newTopicTitle", data).html(); var newContentHTML = $("#newTopicMessage", data).html(); if (newTitleHTML && newContentHTML) { $("#topicTitle").html(newTitleHTML); divMsg.html(newContentHTML); } else { divMsg.html(data); } } The alert(data); code line returns the following HTML code: <div id="newToticTitle">New
Next Page