Add text in the beginning of element
Let's assume I have an a-element <a href="url">Link text</a> I know how to append text $('a').append("Some text"); I would like to add text before the Link text so it would look like this: <a href="url"> Some text Link text</a> Any suggestions?
Targetting specific nested elements of $(this) efficiently
My HTML: <div class="home-button"> <span><a href="#" style="">Button</a></span> </div> I have an instance of a div (button), inside this div is a link wrapped in a span. When you hover over the div (".home-button")I want to move the background position inside its "span a", I've achieved this using the code below. My Script: $(".home-button").hover( function () { $(this).children("span").children("a") .animate({backgroundPosition: '0px 0px'}); }, function () { $(this).children("span").children("a")
.scroll() API
Hi How can I intercept the button that triggered the event scroll
Conflict between jquery-1.4.4.min.js and another javascript code
Link : http://localservicii.ro/SDC/site/prima.html I use jquery-1.4.4.min.js for change tab. jquery-1.4.4.min.js cancel the function of this javascript code: <script type="text/javascript"> var box = {}; window.addEvent('presentationBanner', function(){ box = new MultiBox('mb', {descClassName: 'presentationBanner',x:0,y:-30}); }) </script> <script type="text/javascript"> var BannerRotator = function(){ var bannerList = document.getElementById("list_of_banners").getElementsByTagName("li"),
jQuery: code to validate before submitting
Hi, I'm trying to validate my form before submitting it. I'm trying it with this code below, but it always submit the form values: $('#gestione_profilo').submit(function () { $("#gestione_profilo").validate({ rules: { 'person_data[document_number]': "required" }, messages: { 'person_data[document_number]': "required" } }); form_data = $(this).serialize(); $.ajax({ url: "<?php echo url_for('profile/index') ?>",
Birthday calendar
I am looking to add a JQuery pop-calendar to a form field for birthdays, but all that I have found so far like this one.http://jqueryui.com/demos/datepicker/ - are more for currents dates. If you are an old person (like me), you have to do much clicking back to get to your birthday. Any better solutions for birthday picker?
Prevent the back action after logout??????
Hi Friends, After logout if i pressed back button in browser ,it should not show the previous page ,it has to go to default page(login page only). So i have tried in many ways(ruby on rails application) like "history.forward()" ,"onbeforeunload",expire cache in meta tag,"http://www.brookebryan.com/ back button detection"so many .. i have confused a lot Is there any way is there in jquery
Problem attaching duplicate functions to events
So we are developing an ASPX website which uses a master page and content pages. Some pages have a GridView to look at data in a database and we have created a global js function to do a delete confirmation when the delete button is pressed for a given record. The problem is that on initial page load the confirm is poping up twice. Then after a postback the delete is only poping up once. So the popup function is obviously being added to the delete button even more than once. The weird issue is that
Form Validation with Jquery not working
Hello, Ive made a form validation with jquery with the following code $('#save').click(function(){ $.ajax({ url: "../scripts/availability.php", type: "POST", cache: false, data:{ stamp: $("#stamp").val(), jprefix: $("#jprefix").val(), tprefix: $("#tprefix").val(), starting_date: $("#starting_date").val(), ending_date: $("#ending_date").val(),
help with additional email validation
I have a form which uses JQuery to validate fields and PHP to submit to DB. Current validation only looks to see if a field is empty and if it is displays and error msg. I would like to add addtn't functionality to check to see if an email address is invalid and if so displays an invalid email address msg. Need some help doing that please. Current JS validation looks like this. $(function() { $('label.error').hide(); var email = $("input#email").val(); if (email == "") { $("label#email_error").show();
multiple slidetoggle in dynamic content
hi there. i use the slidetoggle to show and hide the caption over an image. i'm using a galerie an so i have many images with many captions. the slidetoggle works but on every image the same. take a look at: http://denis.stefansenn.com/index.php/tv.html i dont' get it work for each image independently. it should work like...if i hover an image the caption should come. if i leave this image an hover an another image the caption of image one should slide down and the caption of image two should slideup...
How to load two pages with .load in to two different div ??
Hallo. I'm begginig with jQuery. I'm trying to make a simple menu with jQuery. this is my .js code. $(document).ready(function(){ $('#menutop li').click(function() { $('.current').removeClass(); $(this).addClass('current'); var menu_down = $('.current').text(); var link_koncowka = $('.current').text() + '.php'; $("#srodek").load( "inc/"
How to add a div in jquery even if you have just used the .remove() function on it
Hi, Below is my code which I am using to remove a div tag. I also want the script to add the same div tag later once certain conditions are meet. The div has some preloaded content too which I don't want to loose. What function do I use to add the div. .add() does not seem to work. $('#wrapper1').remove(); Any help will be highly appreciated. Cheers, Vishal
wrap() not working like I want it.. No Surprise.
Ok, I have a jqGrid plug-in that goes out and gets a static xml file from web and then pushes data within certain nodes to specific divs/html elements. I also am running a prettyPhoto plug-in that dynamically develops a slideshow. Within jqGrid onSelectRow option, I have $(data.picsequence).wrap("<ul class='clearfix tabArea'></ul>").appendTo('#slideshow'); This wrap is what does not work. What am I doing wrong??? Firebug shows the div slideshow and then directly under it the li element. NO
How do I retain a class after a link is clicked - for pseudo checkboxes.
I'm creating a list of items which visually look like checkboxes. They will work similar to the ones used on eBay that allow you to select only new/used items. Mine are a little simpler though. Here is the markup: <li> <a href="#" class="catHeader trigger">Designers</a> <ul class="nav-ul toggle_comtainer"> <li><a href="index.html" id="d1" class="select">Stills</a></li> And I've written
href and jquery problem
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('#action').hide(); $('#open_hover').click(function(){ $('#action').fadeIn(500); var order_id = $('#open_hover').attr('href'); $('#action_content').append('<p>'+order_id+'</p>'); }); }); </script>
Using Same function on different event
I am using JQuery Validation Plugin but I need to Validate some but and don't want to validate some button. How can I achieve this.
How to check button click in Jquery validation
I am using JQuery validation for asp.net my project... I am facing a problem with the ajax base form.. I am handling the validations on postbacks. I just want to do it on click event.. like checking for a button click event in the page..I do have 3 button in my page and a asp.net grid. If i click on the paging it doing a post back the validation triggers... so I just want to check for if(its a button submit) { validate the form.. } Here is my code: var isValid = $('#form1').validate({
selecting sibilings after a variable position in a list
I tried to make the title s meaningful as possible. I am trying to select n number of sublings in a list of elements after a specified point. I have a table with a number of rows (tr) and each row has a link and a checkbox. On clicking the link, I want to check the checkbox on that row and for the next 5 (say) rows but not the previous ones. Something like this... <table> <tr> <td><a>Link</a></td> <td><input type="checkbox"></input></td> </tr> <tr> <td><a>Link</a></td> <td><input type="checkbox"></input></td>
live() method does not work if selector has dot character
I am trying to work live method work but could not if id/name has . (dot) character. jQuery1.4.2 Example: <html> <head> <script type="text/javascript" src="../scripts/jquery-1.4.2.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('[id="state._[0]"]').live('change blur',function(){
Simple syntax question
Hey guys, I'm trying to replace the #selectList with $(this) so I can get the changed select menu's text. I just can't figure out the proper syntax for putting $(this) in it. Thanks in advance, Twitch var productLabel = $('#selectList :selected').text();
find() in IE
<html> <head> <script language="javascript" type="text/javascript" src="jquery-1.4.4.min.js"></script> <script language="javascript" type="text/javascript"> var xml = '<?xml version="1.0"?><root><t1>c1</t1><t2>c2</t2></root>'; alert($(xml).find('t1').text()); </script> </head> <body></body> </html> in FF this script returns 'c1' and $(xml).find('t1').length == 1 in IE - empty string in alert and $(xml).find('t1').length == 0 How
jQuery validate select onChange
Hi, I'm trying to validate the state name of a country in a form when enter a state name I have it validated ( in "xhr/xhr_validate_key.php" ). Would need when I change the country (in the country_id.onchange) revalidate the state name The state name is marked as invalid and not sumit the form if I change the country Sorry for my bad English, I'm from Argentina <tr> <td>State Name</td> <td> <input type="text" name="name" id="name" value="<?=$name?>" maxlength="50" size="52"
Having problem with codylindley DOMWindow and jquery UI Slider on IE:
I'm using the Cody Lindley DOMWindow script, modeless, draggable for a popup form that has a jquery UI slider. All is working well except with IE - the problem is when I slide the handle the window drags. If I position the cursor slightly to the left or right of the slider handle, it slides fine. Any help would be appreciated. My slide event is as follow: slide: function(e, ui){ if(e.target==this) { $j('input:text[name=rate]').val(ui.value+'%');
Problem sending JS variables/array to PHP with jQuery.post() function
Hi folks, I'm having a big problem here. In fact, I guess I'm almost there, but there's a little something that keep me struggling. Here's my challenge: I have a page (full url: http://uren.visueel-adv.be/overview, url with .htaccess: /overview) that carry a table with the performances/jobs from the employees in our company. The table is generated with PHP and MySQL and each table row contains the following data/cells: - Performance ID (invisible) - Date - Customer - Employee - Begin time of the
AJAX call in method does not return result ?
I am calling an AJAX function from a certain method, but for any reason it does not return the result. The JSON object is "Records". The URL is build within another method and properly passed (as I can see in Firebug) DataService.prototype.myData = function (jQ_dataelement) { $.ajax({ type:'GET', contentType: "application/json; charset=utf-8", url:this.webServiceLink, dataType:'json', success:
me.com login error-shake
hey did anyone notice the new me.com? very nice Login-Form, special the error-shake. (and check the fancy paricle-flow by the devices, guess is all Javascript & HTML5) my question is: how to build this error-shake in jquery? maybe someone already did this in jquery? thanks for any info
Selectbox styl option or optgroup
Hi, I would like in the selectbox tag option styl css or, when I put tag optgroup does not work in the jquery. Thank you <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <title>Styling Select Boxes</title> <link rel="stylesheet" type="text/css" href="selectbox.css" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"
Adding another object doesn't work
I have attached a simple script where you can move small images to larger image. It works fine but I have a problem adding another small objects - they can't be moved, they are just static. Is anyone so good to check what is causing this problem?
Problem: How to call a script after a ajax partial view refreshed?
I have a jQuery script that would highlight some listbox items (listbox is on a partial view) on document ready. My problem is, the highlights in the listbox gone after the mvc controller ajax post return the partial view. How should I call the highlight script again after the ajax post return? Thanks
jQuery Current Date?
Hello, I'm trying to set the current date in a <h2> tag on a page I'm developing. I've spent some time researching around the net, have seen some straight JavaScript methods, to do so by setting an array etc. I'm looking to format the date as such Nov. 9, 2010 so - abbreviated month, date, then full year. Does anyone know how to perform this with jQuery? Thank you for your time in advance. This forum is a great resource! I'm assuming this is a rather easy solution?
Image Carousel not repeating in IE 7 & 8
Good day to all jQuery-ers (or something like that :P) I'm new here so before i post my question i'll just introduce myself quickly. My name is bryan. i am 18 years old and live in the netherlands. I'm currently studying IT and i love anything to do with PC's and especialy programming (webdesign / development) Oke my problem: I've build a image carousel "plugin" (its not a real plugin). The basic principle is simple: Load an img tag with a SRC when the dom is loaded, then count to x (6 seconds for
Fetching a Querystring in URL
Hi there! Thinking if there´s a nice way in jQuery to display, in my case a Searchterm in a searchresult page, like 'Searchterm: (some word). I got it working with a piece plain old JS, exept for one thing; I had to display only the first querystring (in this case it could be many QS ) SomePage.aspx?s=someword&pagination1=11 I want to fetch only the first output: 'someword' not what comming after, like cut everything from & to the right. Any ideas would be great! function querySt(ji) { hu = window.location.search.substring(3);
Visible div height
I have a div with several elements in it being hidden (display:none). I need to get the height of this div, but only of what's visible. $("#myDiv").height() returns the total height of the div, including the height of all the hidden elements inside it. Can someone help me?
Animate an element being animated
Hi guys, there is a way to add an animation to an element that is being animated? I explain better. I have an element called #example, i call $(#example).animate({"left",500},10000}, after 5 seconds i want to animate also the top attribute, then i call $(#example).animate({"top",500},10000}. It does not work. I have to stop animate, then create a second animate, or there is some way to merge the two animations? Thanks for any reply
I have problem using jquery Onclick and $(document).ready on IE 9 (IE9 standards document mode)
Hi All I have problem using jquery Onclick and $(document).ready on IE 9 (IE9 standards document mode). My following code does not work on IE9 $(document).ready(function () { //min font size var min=9; //max font size var max=16; //grab the default font size var reset = $('p').css('fontSize'); //font resize these elements var elm = $('div.wikiarticle,div#column-content,div#term,p,font.font24,li,h2,pre,h1,.tab_content li,th, .tab_content h4,td,p,.size_18,.size_12,#creattime,.mw-headline,span.bold,.color_blue_2');
disable click function
I have an image map with various areas on it. A user can click on the various areas and something happens. That said, I sometimes need to disable the ability to click on some areas. For instance areas whose id attribute contains 0 0. I have the code to split the id and grab whether the values are 0 or 1 and the alert pops up when one has 0 0 in the id but it's still clickable. I thought .unbind would do the trick, but it isn't. the alert is simply for testing. Any help would be much appreciated.
Jquery getting information from xml issue
Before i submit my problem just to let you know i've been using jquery and javascripting for about a month or 2 now so i appologise in advance if this is something stupid. Basicaly I have created a form with "<select><option></option></select>" using jquery/javascript. My main issue is that i want this to select from a database so i found out that you can get information from php files i just couldn't figure out how to get the variables it submits. I then found out that i can use xml to get the information
Fold/unfold only the div I select?
Greetings, I am a newbie who just started with jQuery. I am building a basic PHP app for our team that displays a list of open helpdesk tickets. To avoid cluttering the screen, I only want to display the title of the ticket and if clicked, its description. I have attached my code in a text file Right now, my code works but unfolds all the divs for all open tickets, regardless of what ticket name I clicked. Ideally, I'd like to show the description of for the ticket name I clicked. Not all of them.
Traversal from frame to frameset
I'm trying to figure out how to traverse from a frame (basically a header region) to the frameset, to alter the height of said frameset. In example.php below, I want to change the rows value of <frameset> from an event trigger in a script in example-header.php <frameset rows="49px,*" frameborder="NO" border="0" framespacing="0"> <frame src="example-header.php?url=<?php print "$url"; ?>" id="header" name="frame" scrolling="NO" noresize> <frame src="<?php print "$url"; ?>" id="main" name="main">
Next Page