selector within local scope
Not sure how this can be done in jquery, need help... Let me explain the question using an example: <html> <head> <script type="text/javascript" src="jquery-1.4.2.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#span1").click(function() { alert($("img:eq(1)").attr("alt")); }); }); </script> </head> <body> <div id="div1">
get ID
Hi. am quite new to jQuery. am trying to get the id of a button, hide a div with the same class name, and show a div with a different class but with the same number. example: $("#info2").click(function () { //the id of the button clicked $(.info2).hide(); // the class of the div to hide $(.edit2).show(); // the class of the div to show }); any ideas? i will greatly appreciate it
Sorting row without jquery sorting utilities but using jquery.
I have a page that have a table with some rows... Es. : <table ID="table"> <tr ID="5"><td>5</td></tr> <tr ID="11"><td>5</td></tr> <tr ID="27"><td>5</td></tr> <tr ID="2"><td>5</td></tr> <tr ID="16"><td>5</td></tr> </table> by some function and process (i dont explain all to gain time) i get to the page (via AJAX) a new ID order (16,2,27,5,11) Now i want to RE-order the row of the table following the ID array. How can i do this using jquery? I also have possibility to use tablednd plugin. I
slideDown, slideUp, quick mouse movement
Hello, I have a problem with function slideDown and slideUp. The webpage where is the problem: http://www.sarkapancochova.cz/en/ On homepage are 4 blocks, which slideDown on mouseenter and slideUp on mouse leave. When I move with cursor slowly everything i fine. But when movement is faster and quickly hover different blocks, some block hangs and after that doesnt slide to full length. I try change slide function for animate, slidetoggle, but it isnt solve the problem. Anyone knows solution
Login Window Click Problem
Hey everybody, i'm pretty new to jquery and javascript in general so i have som trouble creating a login form which should only display on click. I have an image button with an a href and according class "setvisible" to make a div called "login_box" visible on click. The following should be possible: -> Click on "Login" -> Form opens -> Click on "Login" again should close the form -> Click outsithe the "login_box" div should close the form also I've managed to get it working so far but my problem
jQuery and desaturate/colorize image rollover effect
Hi! With jQuery, is there a way to do a rollover effect which desaturate / colorize an image without using a sprite or two images? Thanks for your response!
How Can I Determine if a List Item Contains a Child List?
I have an unordered list with many list items several levels deep, some of which contain nested unordered lists. How can I determine which individual list items contain nested lists and attach click events to only those list items? For example: <ul> <li>level 1 <ul> <li>level 1-1</li> <li>level 1-2 <ul> <li>level 1-2-1</li> <li>level 1-2-2</li> <li>level 1-2-3</li> <li>level 1-2-4</li> <li>level 1-2-5</li> </ul> </li> <li>level 1-3</li> </ul> </li> </ul> Level 1 and Level 1-2 should have the click
if iframe exist in ie8 ,jquery animate with time can't work.
when click in ie8,it can't work. if remove iframe,it can work. why? <!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"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <head> <style> body{margin:0; padding:0;} #hiddenbar{display:none;width:250px;height:500px;border:1px solid;position:absolute;right:0;top:0; } #editing{width:300px ;height:300px ;border:1px solid;} </style>
Problems getting ID
I have this li: <li class="clickable editfaq" id="edit-type_searches">Edit this FAQ</li> and with this code, I try to get the id of that li. $('.editfaq').click(function() { alert($('this').attr('id')) }) But the alert always returns 'undefined'. What am I doing wrong?
Swap Multiple Divs on Page without triggering the others.
Hi there - I'm new to jQuery - but I'm really loving it so far - can't wait to dig in. Currently I'm using this code: $(document).ready(function(){ //when a link inside our thumbba div is clicked $('#thumbb a').click(function(event){ //prevent the default behavior(going to the page) event.preventDefault(); //get the href attribute of the link var link = $(this).attr('href'); //replace the swap-a div with the new content
How to target an element inside an adjacent element...
Setting up some basic styling for left and right aligned images in WordPress. The left aligned image's standard CSS is {float: left; margin-right: 20px;} and the right aligned image is {float: right; margin-left: 20px}. This is fine for text wrapping, but causes problems if a right aligned image is placed immediately after a left aligned image, because the margin-right and margin-left make the total width more than the container div, and so the right-aligned image drops down. WordPress renders these
How to format a date value in TD tag
I am populating a Table data using Ajax calls. It has one column with Date field which is fetched from database as "YYYY-mm-dd" I want to show it as "dd/mm/yyyy". TD value is <TD class='tabledob'>1981-03-12</TD> I have tried following to format it but didn't work $('.tabledob').datepicker({ dateFormat: 'dd/mm/yy' }); OR $(".tabledob").dateFormat('dd/mm/yy');
Stop animation from fully executing?
Hello. I have no previous programing experience so I find myself struggling with even adapting tutorial made navigation to my needs... Anyway, I have this 3 state/sprite/jquery navigation bar, in two(2!) versions, got them by using 2 different tutorials. And neither one does exactly what I want... #1 First one uses minimal javascript and is really awesome and smooth, but I can't for the love of God make it to keep buttons pressed... code: <script type="text/javascript"> $(function() { $("ul#menu
Nothing is Working for me in IE8
Not even with compatibility mode, nothing works at all, Jquery is simply not running, I'm trying to make the following simple code working: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script type="application/javascript" language="javascript" src="scripts/jquery-1.3.2.min.js"></script>
How to Calculate a %?
I have some data thats in a number, lets say 5455. Id like to get the TAX from an input, say like 2.5 percent. The formula is: Tax Total = 5455 * .025 = 136.37 Actual Total = 5455 + 136.37 = Whatever. $taxPercent = parseInt($('#tax').val()); This obviously isn't the right formula that's okay, I just don't know why I keep getting NaN. Im not sure if this will preserve the decimal either. $('.bigTax').html($total * $taxPercent);
how to pass a value through ajax
hello check this code! var boxval = $("#content").val(); var dataString = 'content='+ boxval; var fanid = $("#fw").val(); var fidvalue = 'fw='+ fanid; $.ajax({ type: "POST", url: "update.php", data: dataString , cache: false, success: function(html){ but now i am getting dataString value , i want to pass fidvalue also how to get that in update.php help me
.hover() help
Hello all, I am fairly new to javascript and jquery for the most part. I am trying to instill a seemingly simple navigation/subnav .hover and .slideDown transition to the subnav but I am having a few problems. When I hover over the main navigation, the subnav slides in just fine but when I go to hover over the subnavigation, it disappears. Obviously I want the subnav div to remain on the screen until I hover off of the id="nav_a" or until I hover off the subnav div completely. Hopefully I am just
How do I do this MooTools effect with jQuery?
The menu on this page has menu items that "bounce." http://www.easports.com/celebrity How can I get an effect like that in jQuery?
jQuery.post() 1.4.1 is appending [] to vars when posting from array within array
The following jquery.post is adding square brackets to each element contained in the inner array. This is causing and error binding the post data on the serverside as the syntax does not make sense. e.g. mycheckbox1[]=2&mycheckbox1[]=3. Code snippet below... each of the data.parentGroupIds elements is getting posted with a trailing []. It does not do this in V1.3.2 function fetchProducts() { $("#productTable").html('<table class="transparent"><tr><td><span>Fetching publications...</span></td></tr></table>');
Exchange Button with an Image?
Hey Guys, I`am using jQuery to hide / show content and I want to exchange the Button (<button></button>) with an Image, which I can press like a button to show / hide the content, but I dont know how I can handle this. This is the jQuery file I use: http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js ------------------------------------------------- This is the Script-Code: <script type="text/javascript"> $(document).ready(function(){ $('button').click(function() {
Anchors and class
What am i doing wrong? I'm trying to toggleclass on a link, with the href of the current anchor var anchor=window.location.hash; $('#nav a[href='.anchor.']').toggleClass('active');
jCarousel Configuration - Autoscroll + navigation problem
Hey Guys, I'm having a little trouble setting up jCarousel - www.lovejungle.com/store Basically I want it to look like the slide show on www.ripcurl.com.au/?home I've got as far as implementing the jCarousel - But the configuration and navigation buttons arn't right. AS you will see jCarousel starts on the first image, but then skips two images, and lands on the fourth image in the set. I'm not sure why it's doing that ? Any ideas? Secondly - I can't get the default 1,2,3,4,5 navigation happening
Issue with IE and Jquery/PHP load()
Hey guys, new here, but planning on making this a regular place to help me learn Jquery. I wrote a small script that animates, loads content from a PHP script into a div, then animates again. It works splendidly in firefox, but for some reason, in IE, it won't load fresh content from the PHP file, even if I reload the page. Given that the PHP works fine in Firefox (and I've tried clearing variables in it), I can only assume that I'm doing something wrong. Can you check it over? Here's my code: $(document).ready(function()
jquery function problem
I have a problem with jquery. What I would like to make is that tabs will change a class when somebody clicks on a tab. Everything else works ok, excepting this. I spent couple of hours on this and it still doesn't work. It works only when I click on a tab 1st time, but than not anymore. I tried to include click function inside another function and also many other combinations and still doesn't work. I would be so glad if anybody can tell me where exactly I should include the last click function.
Updating multiple DIV based on the previous DIV
Hi! I have the following HTML: <div id="box"> <div id="inner-new"> content </div> <div id="new"> new content </div> </div> This code block occurs several times. Sometime the first div ist just "inner" and the second div is missing. Now I need to update the "new" DIV based on the height of the previous inner-new DIV. For one it works fine: var height = $('#inner-new').outerHeight(); $('#new').css('margin-top', height*(-1)-30);But how
ajaxError event is not triggered by javascript errors
Hi Everybody! i've just noticed (after hours of bughunting), that jquery ajaxError event is not triggered by javascript errors, and i think it should be. So for example, when a Ajax success callback has an undefined function call or something, it just fails silently, instead of reporting the error into the firebug console. Am I missing something here? Thanks.
Handy addClass use in .append
$('body').append('<div id="mydiv"></div>).addClass('newClass'); addClass can be used to add a class to a selector. Take the above example. If the class is added to 'mydiv' instead, not body, this could be handy than writing the two lines: $('body').append('<div id="mydiv"></div>); $('#mydiv').addClass('newClass');
Simple image load detection with .load()
I have a fading photo slideshow which I would like to initialize after the first image is loaded. I was working on the following to detect if the image is cached or not and act accordingly. $(document).ready(function () { if($('.slideshow li img')[0].complete == 'true') { // first slideshow image is cached, start the show $('.slideshow').cycle({ fx: 'fade', speed: 1500, timeout: 5000}); } else { // first slideshow image is loading, bind a load handler
selector logic - ":not(.stars) a"
Hi, I'm trying to attach a colorbox to all the links on a page except ones within a div having the class 'stars'. Shouldn't I be able to do this using jQuery(":not(.stars) a")? This seems to completely fail to exclude the stars (which happens also with div:not(.stars) and other classes), it's just as if the :not clause wasn't there at all. Am I doing something obviously wrong here?
Block link with lightbox
I have a number of divs, each containing an image that launches a lightbox gallery. A text description is also within the div and underneath each image describing what's going on (I don't want it as part of the gallery), but it doesn't contain a link to the lightbox. Each div (and everything in it) is needed to be the button that launches the lightbox (ie, clicking anywhere in the ".project" div launches the gallery). How do I do this? <div class="project"> <div class="project-image"><a
Browser Resize
Hi- I am using this code that essentially has a fullscreen div, when you click the button, another fullscreen div slides in. $(document).ready(function() { $("a#controlbtn").click(function(e) { e.preventDefault(); var slidepx=$("div#linkblock").width(); if ( !$("div#maincontent").is(':animated') ) { if (parseInt($("div#maincontent").css('left'), 10) < slidepx) { $(this).removeClass('close').html('Hide your
Show "loading" image when clicking a link
There's an outgoing link on my website that is sometimes slow to respond. I want to show a spinning wheel image after clicking it. Here is how I do it: $("#thelink").click(function() { $("#somediv").addClass('loading'); }); There are 2 problems: Firefox doesn't remove the "loading" class when going to another page and clicking the browser's Back button. Any ideas how to solve it? Google Chrome doesn't add the class "loading". Instead it immediately opens the page targeted by the link. I solved
Selector issue
Hi all, I have the following HTML: <div class="ProjectTest"> <table> <tr> <th>Name</th> <th>Description</th> <th>Due Date</th> <th>Status</th> <th>Reason</th> <th>More Info</th> </tr> <tr class="editing"> <td class="data">Sample Completed2</td> <td class="data">Test such and such</td> <td class="data">03/02/2010</td>
jQuery Slide Show Help?
I am a designer looking for some help in creating a slide show for my folio using jQuery. My site is at: www.plastikempire.com. I am looking for a slide show like this site: http://www.andmelbourne.com/#1 but I have no idea on how it is implemented. I do have some knowledge of building sites in Dreamweaver. If someone is willing to give a helping hand, maybe it is possible to trade service's some how. Cheers.
Problem to make manipulation with ID
I have <p class="govnocms" id="111">mother</p> <p class="govnocms" id="222">mother</p> <p class="govnocms" id="333">mother</p>I need it convert to: <p class="govnocms" id="111">111mother</p> <p class="govnocms" id="222">222mother</p> <p class="govnocms" id="333">333mother</p>my varian of jQuery query incorrect: $(".govnocms").prepend(this.attr('id')); why ? Where error ?
Expanding a form
Hi all, I am new to javascript and jQuery. I have this simple form that sends collected data to my email: <form action="mail.php" method="post"> <input name="name" size="25" type="text" /> <textarea name="txt1" rows="5" cols="40"></textarea> <textarea name="txt2" rows="5" cols="40"></textarea> <select name="type"> <option value="">---- select ----</option> <option value="counseling" >Counseling</option> <option value="training" >Training</option> <option value="other" >Other</option> </select> </form>
Flash + jQuery, can it works?
Well, first of all, i wanna say that i'm very impressed with jQuery, i'd never seen a so useful tool to my works like it, but.. here's my problem, I'm making a site 100% in Flash, but with and edit system to the texts, it works like that - the flash is embed in the index, and uses as text a .txt file with some parameters that define the local of every text - my question is, can i put a dialog on this site? it will works? oh,sorry for the bad english, it ain't my 1st language ^^"
jQuery Online User Group
I have started a jQuery online user group . This is a place to meet monthly to learn, share and promote jQuery, jQuery expertise and unique and interesting uses of jQuery. The group will be hosted on Yamisee and held monthly. I'll be looking for topics and speakers for each session. You can contact me on info at mercatus3 dot com if you are interested in leading a session. There is a nominal fee ($3.99) which just covers the cost of the online room and will decrease if we have regular sustained participation
goto anchor after .load
With the following code I can load/overwrite html code to a specific section in the 'base' html document: <div id="changedSection"></div>and $("#changedSection").load("someURLaddress"); Now how to get directly displaying a 'requested' section in the loaded part of the document? Adding an anchor like "someURLaddress#myAnchor" isn't successful here. Any thoughts? Guenter
load part of the page
hi i have 2 pages one is the main and the other is the sub-main ------------------------------------------------------------------------- main,html : <A href="sub-main.html#post5>go and load just post 5</a> ---------------------------------------------------------------- sub-main.html : <DIV class=posttop id="post4"> here you can write anything ;) </div> <DIV class=posttop id="post5"> here you can write anything ;) </div> <link type="text/css" href="post.css" rel="Stylesheet" /> <script type="text/javascript"
Next Page