changeing class
hello, i have a lot of same tables: <table> <tr class="class"> <td>some text</td> <td><a href="#" OnClick="$('.class').click(function() { $(.'class').removeClass('class'); });">click here</a></td> <td>some other text</td> ..., some other links... </tr> </table> <table> <tr class="class"> <td>some text</td> <td><a href="#" OnClick="$('.class').click(function() { $(.'class').removeClass('class'); });">click here</a></td> <td>some other text</td> ..., some other links... </tr> </table>
change class name
hello, i have a lot of same tables: <table> <tr class="class"> <td>some text</td> <td><a href="">Click here</a></td> </tr> </table> <table> <tr class="class"> <td>some text</td> <td><a href="">Click here</a></td> </tr> </table> ... when i click to link, i whould like to change class name of <tr> element, where i clicked. i don't know how can i do that. i try something like that: <a href="" OnClick="$(this.tr).removeClass('class'); $(this.tr).removeClass('_class');">Click here</a> but it doesn't work...
Getting image by source with special characters
Hello, I'm trying to get some images on my page by their src attribute. Src attribute have this format : src = http://localhost:8888/mapviewer/mcserver?request=gettile&format=PNG&zoomlevel=0&mapcache=MAPNAME&mx=0&my=0 For doing that I'm using the following query : $j("img[src*='request=gettile'][src*='"+$j(this).data("target")+"']") $j(this).data("target") contains my mapname, it works fine. But my users can use mapname that can be contained in another map names. Example : mapblabla and pbla. When
How is this effect achieved?
I was wondering if anyone knows how the effect with the clouds is achieved? See effect here: http://osc.template-help.com/joomla_23891/ There are about 4 images that sway back and forth, following the mouse movement. I downloaded all 4 .js files (jquery.js, mootools.js, caption.js, and script.js). They are all in the same folder as my .html file that is linked to my .css file. My css file contains the following code: #parallax { position:absolute; overflow:hidden; width:100%; margin:auto;
CDN Hosted jQuery does not allow cross domain origin access
I am trying to use the hosted version of jQuery in a userscript, but the only way I am able to do so is by loading it using an xmlhttpRequest (More details here). Since xmlhttpRequest restricts access using the same-origin policy I would need to either host it on the same domain as the website (not feasible for a user-script) or use a CDN that includes the Access-Control-Allow-Origin: * header defined by Cross-Origin Resource Sharing. Is there any way to change the code.jquery.com CDN so that it
upload file ajax
comment puise je envoyer un formulaire qui contien un input de type file avec submit sa marche sons aucun problem mais avec $ajax et .serialize sa ne marche pas gifted computer
Help... I need build a gui to draw a workflow with jquery
The workflow that I need to draw is very simple, I need to draw proccess box, conditional box and connections. The process box and conditional box, is OK, but connectors I don't know please help me
brief, full sized, randomised image shown on page load
I need to fade in a an image (it will cover all content) of 100% height and 100% width for 3 seconds each time my index page loads, and then fade out. It also needs to be a randomised image (1 of 6). I have been searching for over two hours and I am not having much luck. Can anyone point me in the right direction?
jQuery FadeIn.FadeOut over <li> array
Hi there, I think this is a simple problem to solve, but my lack of javaScript/jQuery knowledge it a severe hinderence here! I have a page that has 8 thumbnails on it, split over two rows (so 4 thumbs on each row) and then floated to the left etc. What I'm trying to achieve is for a larger div1 to fade in when hovering on thumb1, and then fade out once not hovering; and then the same for thumb2 (div2), thumb3 (div3), etc. The div code is here: <div id="productlogos"> <ul>
.Each Function stops working
I have a table with a SAVE button on each row (id=SaveBD)...but I also have a SAVE ALL button at the top. It works pretty good except the .each function seems to randomly stop near the end of the row count and not save all the rows. Here is the function - is there any mistakes that would cause the rows to stop saving? Thanks!! $(document).ready(function(){ $("#SaveAll").click( function(event){ $ ("#SaveAll").hide(); $("*[id^=SaveBD]").each(function(index){ if
Adding Custom Attribute Tags to HTML Elements
Here's what I'm trying to do: 1) I get reference to a div that's on my page: var theDiv = $("#" + divID); 2) Now I want to add a custom attribute tag to it, so for instance I want to add "winWidth" so that the div object now contains "winWidth=" for instance. 3) I want to set winWidth now since it's part of theDiv to a value I'm not sure how to really do 1 + 2. I need to do this on the fly because some javascript logic later will add these attributes dynamically to the div... outside of what the
page turn over
hey i have a question and maybe a suggestion for a new plugin for jquery. Since 3 hour i have searched an plugin to simulate a turn over page. Like this: http://www.flashkit.com/movies/launcher.php?url=http://www.flashkit.com/movies/Applications/tcClassi-Benny_Vl-4481/tcClassi-Benny_Vl-4481.swf&width=995&height=464&bg=#000000 is it possible use jquery for such effects? Or is it only possible with Flash? thx for your help =) Stefan
IE7, HTML5 & Excess Tags with .after()
I'm uncertain if this is actually a bug, or if I'm just too new to jQuery to know the correct way to handle this. I'm working on my first HTML5 project, and as you're likely aware, several HTML5 elements aren't supported out of the box by IE7. A JavaScript must be used to declare them. The one I'm using looks like this (just an array of elements that's looped through and created): <!--[if lte IE 8]> <script> // For discussion and comments, see: http://remysharp.com/2009/01/07/html5-enabling-script/
php include breaking jQuery
Was wondering if anyone has encountered this problem before. When I put a php include (which the jQuery is targeting) the jQuery breaks. So I have two buttons on the page. 1 button is targeted in the php include. If the include is put in, the button that is not in the include does not work. If the include is NOT put in, the button that is outside the include works, but the one inside the include breaks. Ideas?
Does JQuery play nice with non-JQuery dhtml?
I am having an issue getting an element by ID with JQuery; this element is created by a non-JQuery Javascript function. Before I go and "Report a problem" that may or may not exist I wanted to ask the community first. So, can JQuery manipulate elements generated by normal Javascript?
wrapAll and table rows
I'm trying to apply thead and tbody to a table that doesn't have them. I'm trying to put all tr's after the first in tbody tags by using wrapAll. When I apply the wrapAll to a set of rows, I get two tbody's one nested in the other. $table = $("#myTable"); $rows = $table.find("tr"); $headerRow = $rows.first(); $bodyRows = $rows.slice(1); $bodyRows.wrapAll("<tbody>"); I also get nested tbody's when I try wrapAll around all the rows. $table = $("#myTable"); $rows = $table.find("tr"); $rows.wrapAll("<tbody>");
jQuery render race condition question
Hello, I'm struggling with a race condition and hope someone can help. I have a lightbox (jquery tools overlay). Inside the lightbox I have an iframe containing a page running some jquery code. Upon page render this code does some calculations based on the dimensions of certain elements on the page. My problem is this: the lightbox takes a second or so to come up (effects, etc.). The iframe load is independent from the hosting page. The page in the iframe (the one I'm most interested in) sometimes
Jquery image/swf/flv gallery
Hey: Has anyone built a JQuery gallery that displays images, swfs, and flvs within the gallery container (ie not in the 'lightbox' overlay style)? Thanks
UpdateTargetId and MaskEdit
Hello everybody! first of all i´m from Brazil and my english isn´t good, but let me try explain my problem. I´m using asp.net MVC. I have a page with many partialViews, something like this: Page for each item in model Div id=Blah PartialView Form with UpdateTargetId = Blah /PartialView /div next /Page My PartialView has many input:Text with the plugin meioMask (Mask for textbox). When i submit my
multiple UL and LI to traverse
Hi, i have something like that as menu: <div id='main_div'> <ul class='ul_main current'> <li class='level1 item1'>item 1</li> <li class='level1 item2 current'>item 2 <ul> <li class='level2 item1'>item 2.1</li> <li class='level2 item2 current'>item 2.2</li> </ul> </li> <li class='level1 item3'>item 3 <ul> <li class='level2 item1'>item 3.1</li> <li class='level2 item2'>item
Do not parent page refresh on submit of dialog.
Hi , I am using a GridView control in parent page and I submit the data from RadWindow and close the window , it refresh the Parent page . I want to stop the parent page refreshing and only reload data for GridView in parent page. How can I do this using Jquery and asp.net 3.5 ?? Thanks and regards, Nawnit
getJSON fail on callback
Hello everybody, i'm really stuck and i think this is the only place to get an answer. My situation: i use the getJSON request to fill a select (with cities names) after the user have choosen his region. I paste some code: <html> <head> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" charset="utf-8"> $(function(){ $("select#reg").change(function(){ alert ('start'); alert($(this).val()); $.getJSON("script/getProvinceRegione",{id: $(this).val(),
Posting data via Ajax
Hello, I have a project where you have two sortable lists and the contents of one list are saved to a DB. Everything works except $.ajax() seems to do nothing, not even error. Can anyone help me out? function addItems(){ var projects = ""; $('#sortable2 li').each(function(){ projects += this.id + ", "; //$('#output').html(projects); }); $.ajax({ type: "POST", url: "savelayout.php", data: projects }); }
How make a success message after redirect
Hello folks. I have a problem. I've got a form for adding a person to a textfile. The form is made with html and i submit it to a perl-file, where i read out the input and write it in a textfile. After writing the file i want to make a redirect to an overview page with each user and there i want to have a success-message ("user successfully added"). Now my problem: How do i make this success-message on the overview-page after the redirect from perl? I know, i could just redirect to the overview-page
What's the fastest way to select child elements?
Hi, Let's say I want to select all the input elements of a particular form with id #form. What would be faster? 1. $("#form input") or 2. $("input", "#form") In my (rather unscientific) test using firebug, 2 seemed to be almost 50% faster. Regards, Maarten
Cannot use "this" in plugin
Hi, I am trying to write a plugin but have problems using "this" as reference to the object for which the plugin was called. My plugin looks like this: jQuery.fn.fadeInImage = function() { // for testing alert( this.src ); this .hide() .load( function() { $(this).fadeIn(); } ) .each( function() { if(this.complete) { $(this).trigger("load"); } } ); return this; }; This is embedded in the page as follows (picture.js is the file where the plugin code is stored):
jquery is not able to find a form's action attribute.
I have a typical problem with the way JQuery finds a form’s action attribute. Following is the code I am using to fetch a form’s action attribute $("form").each(function() { $(this).attr("action", ($(this).attr("action")) + "/submit"); }); It works fine at most of the places. But for some of my pages that have property="action" for an input element or a hidden attribute
SelectorSpeed - Selector benchmark JavaScript frameworks
Hi! On my site SelectorSpeed you can find my selector benchmark JavaScript frameworks. You can try it yourself on this web. Already you can check jQuery, MooTools, Prototype, YUI and Dojo.
Selector problem: $('#\\<foo') and $('#bar\\>') works, but $('#\\<buz\\>') doesn't.
I found a problem with the following code: <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'> <head> <meta http-equiv='Content-Type' content='text/html;charset=UTF-8' /> <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.js'></script> <title>Selector Escaping</title> <script type='text/javascript'> //<![CDATA[ $(function(){
XML parsing - more complicated XML documents
I have the basic parsing down no problem - I can read in an XML document and use foreach and find combinations to get to the basic elements I want to get to. The problem I'm running into is that I need to do more sophisticated parsing with multiple foreach statements: <html> <head> <script> $(document).ready(function() { $('#example').click(function() { $.get('http://localhost/receipts.xml', function(data) { $('#output').empty(); $(data).find('Receipt').each(function() { var $rec = $(this); $(rec).find('SaleItem').each(funtion()
Jquery.get() not working with new div content
Hi there, I've got a strange problem... I have my code: jQuery(".statusLink").click( function() { alert('click'); jQuery.get('<?php echo base_url()."index.php/profile/"; ?>'+ jQuery(this).attr('id'), function(data){ jQuery("#statusBar").html(data); }); } ); My html is as follows: <div class="span-11
show / hide images based on checkbox state
Hello Guys, I've got a little HTML to get me started on this http://pastebin.com/G41V9Wt5. What you can see is that I have a bunch of images which form a chart, each of the images has multiple classes. I want to write a function which when called fades in/out images dependant on whether all related checkboxes are checked or not. Checkboxes are related to the images by id on the checkbox and class on the image, as I'm sure you can see. The idea being that I will be calling this method each time a
Why attribute selector span[style*=red] doesn't work ?
Hi all, I need to scrape red colored span's from the page; here's the test: var html = "<SPAN style='color:red;'>warning</SPAN>" var warnings = $(html).find("span[style*=red]").length; warnings == 0 after this code, while it's expected to be 1. What's wrong ?
form submission problem
Hi All, I am having this strange issue. I have a search form, When the page loads for the first time and user enters search query into form , hits submit the form is submitted successfully and results are returned. Once this first search is over and user wants to input another query and hits submit button and nothing happens. I have checked the logs. The request does go to the server but without any data. No data from form fields gets copied. I have to refresh the whole page in order to get it working
How do I abort a long poll?
Hello! I've got the following jquery code querying my server, but can't figure out how to Abort the query and reload the page immediately if someone clicks on <a> link. Can anyone show me how to abort the current (all) ajax calls if someone clicks on <a> link???? Thanks, regan function doPoll(url) { /* This requests the url "events.php". When it complete (or errors)*/ $.ajax({ type: "GET" ,url: url ,async: true /* If set to non-async, browser shows page as "Loading.."*/ ,cache: false ,timeout: 50000
getting the direct content of an html element encapsulated in an jquery object
I have an piece of html in a jquery object. When I say $(this).html I get: <span class="value">4</span><span class="type">teaspoons</span>butter I want to get only the piece of text from this html segment that is not in the spans. in this example, it is butter. How do I get that? Thanks!
Newbie: Is this possible with jQuery
Hi all, I am relatively new to jQuery and would like to find out if the following animation can be done using the script. Follow the link below, click through the splash page then click on the "product design" link (second from the left) to see how the fly-out boxes animate. I am looking to do something similar without Flash: http://www.espiritudesign.com/ Anybody have any ideas? Thanks! -B
validating on keyup
Hello everybody; I'm trying to validate the text of an input as it is typed. I have this keyup: $(".ent").keyup(function(){ $(this).val( $(this).val().replace(/[^0-9\.]/g, "") ); }); The idea is that only let the user type a decimal number; and it does. The only problem is that it let type a dot [decimal separator I need] at the beginning; and I don't want that :-( I've been a while and searched Google for the Reg Exp, but had no luck. If there's someone who actually understands them, please illuminate
Dynamically adding elements to a form and inserting
Hello all, I am currently working on a site as part of a student work term. One of the features of this site is the ability to upload a resume. The resume can have a arbitrary number of "work experiences". I have set up a form and want the user to be able to add new input elements with a click of a button. Here is a very pared down(for simplicity) version of the form: <form action = 'resume.php' method = 'post' id = 'resume_form'> <div id = 'work'> </div> <input type = "button"
Select Elements with multiple Classes AND Logic
The default behaviour for a class selector is: "An element can have multiple classes; only one of them must match." Is there a class selector where you can use multiple classes and all of them have to match?
Next Page