[jQuery] How to set before and after callbacks properly
I am using the jQuery cycle plugin which is working perfectly. However, I would like to add some more functionality to the image gallery I have created. What I would like to do is after an image fades in, I would like a caption to be display along with the image as well. I think the easiest way perhaps is display the image's alt or title? How would I correctly setup the javascript for this? Thanks! jQuery(document).ready(function(){ jQuery('#frame1').cycle({ fx:'fade', speed:'500', timeout:
[jQuery] autocomplete plugin from bassistance: up and down arrows
Hello, I am using the v1.0.2 of jquery autoselect plugin authored by Jörn Zaefferer, on bassistance.de. First off, thank you for some great code. It provides some critical functionality for the website I am trying to design. Here is the issue that I am struggling with: the up and down arrow keys are disabled in autoselect text input areas. The reason this is an undesirable behavior in my case is that I autoselect "template" phrases that are meant to be modified in some way. These phrases are long,
[jQuery] click events on links
Hello. I have a simple anchor href link on which I put on click event handler: <a href="#" id="pause"></a> $("#pause").click(function () { //do something }); When I click the link the action will be preformed and the browser would scroll to the top of the page (because of # in the href attribute). How do I prevent that? Thanks for help!
UI Datepicker plugin display problem - FireFox
Hello everyone! I have the following situation: There is a forum thread page, where posts are in table rows. I need to show modal box with ui.datepicker on top of this table. When I'm doing this, strange thing happen. When modal box is shown near to the beginning or the end of table with posts - pop-up div is visible and everything is ok. But when box is near to the middle of table - calendar div becomes invisible! z-index of calendar div is 9999, and without a table on background everyithing working
[jQuery] getting element numbers
Hello. I have a simple div list where one of the inner divs is being passed as a this element to the function.
[jQuery] Tablesorter support
Can anyone get tablesorter's default pager function to work? The pager functions don't show up for me. The actual pager div is empty. It DOES limit my table to 10 rows, but when I click on a header to sort a row, my tbody is all the sudden empty. Never have I actually seen the pager control. As a workaround, I'm using .pager() for now. Using jquery 1.3.1 (also tried with 1.2.6, which leads me to believe I'm doing something wrong) Using tablesorter 2.0 Code: <script type="text/javascript"
[jQuery] simple getting elements from ajax response not working
I've got what should be a very simple script, but I can't seem to get anything but 'null' or 'undefined' when trying to get an elements html or id. The 'html(response) gets filled with ther response, but I can't get either html or attribute id from the li. The response has 10 li's, so I'm trying to get all of them, but figured I would do an 'each' or something if I could just manage to grab one. But I can't get that work? Is there something wrong with my code? Here's the code I've got [code] success:
Getting data from the corresponding column.
In this code, I would like to edit the function to get not only the value of the item clicked, I would also like to get information from the thead section for the corresponding column. For example when I click on tBody-1B I would like it to get the value of tHead-1B or if I click on tBody-3C I would like to to also get the value of tHead-1C. To make this example more readable, and to better convey my goal, I've colorized the table. Only the green area is click able (as it should be, the red area
jQuery and rails' RJS templates
I'm not sure if I'm going about this the right way but here goes - I am using both jQuery and the rails default libraries (prototype and scriptaculous) in my app, and trying to send jQuery to the browser inside an RJS template or a render(:update) block. It typically looks something like this: page.visual_effect :highlight 'some_div' page << "jQuery('some_div').css('color', 'red');" But it doesn't seem to work there. If I put the jQuery inside a js file in the header than all is great, but I also
[jQuery] Need help with scrambled open/shut script
I downloaded jQuery a few months ago and used it to make a simple open-shut script. While redesigning/upgrading my websites, I messed it up. I'm not sure if I deleted a critical file, nixed the link to a critical file or what. I published a simplified version of a page at <a href="http://www.geobop.org/Test.php">http://www.geobop.org/Test.php</a> There are four open/shut scripts on the page:<br clear="all"> MyRegions (top center) Microsoft notice (top right) Links (bottom) Books (bottom) I think
[jQuery] jquery.corner remove problem..
Hi all, I am using jQuery corner plugin (version 1.92) and I am adding corner style using onclick method.. But I didnt remove it. function addCorner(){ jQuery('#divName).corner("fray 8px"); } function removeCorner(divName){ jQuery('#divName).corner("none"); } Actually I also tried to change it but the old one was also there.. jQuery('#divName).corner("round"); Do you know how can I remove it? thanks
[jQuery] Changing scope of a function
Hello all, I'm running into a few problems with a plug-in I'm developing. What I would like to do is to take a function (which is in any old scope, global for example) and then execute it in the scope of my plug-in. I rather thought I would be able to do something like in my constructor: this.fnTest = fnGlobalTest; This would take a reference of the global function and store it in my object. It is just a reference being stored, so it looks like it is then being executed in the original scope.
[jQuery] Generate Session ID
I'm transitioning from "old-style" CGI programming to using jQuery to access the server via Ajax. It is customary for me to have the CGI script generate a random string to use as a session ID. Using Ajax with jQuery - would it be practical and safe for the document to generate a Session ID in the onload or document.ready phase and pass it to the server-side script? Comments, caveats and examples are welcome. thanks tim
[jQuery] How to make an element *not* have a function attached...
Strange question, perhaps...but... If I have an element that has an function from a plug-in attached to it, such as: $(function() { $('#myTextarea').expandable(); }); How would I then be able to make #myTextarea "not .expandable"... $('#myTextarea').expandable('disable'); ... Is this something that can be controlled from the page code, or does something have to be built into the plug-in to allow this? Thanks, Rick
[resolved] Adding Content to IDs
Hi, I'm trying to add some content to an id and I'm having a really hard time. I can prepend to the body or other built in tags, but not to IDs or Classes. I'm trying to scrub a form with jquery. The checks in my code all work. I just cannot get content to appear near an id or class. Here is my code/html: <!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"
[jQuery] triggering a link event that has an image tag?
I've been trying to setup a lightbox (or similar) plugin to work with my images, but am having problems due to the <a> tag trigger not firing. It appears that this is because jquery is triggering the <img> event instead of the <a> event. For example: The first one is called when I click the thumbnail, but not the second (which is the one that I want to be called). jQuery(".flickr-photo a img") .livequery("click", function() { alert('img click'); });
[jQuery] Superfish: Error: jQuery("ul.sf-menu").superfish is not a function
Hi, I'm running a Joomla site with the superfish menu (http:// www.sdspaintball.nl) Menu works fine except when I go to the forum section. It displays the menu, but without the downarrow indicator. Also the slide effect is not working as it is on the rest of the site. Error I'm getting is: Error: jQuery("ul.sf-menu").superfish is not a function Source File: http://www.sdspaintball.nl/index.php?option=com_fireboard&Itemid=11&func=latest Line: 29 Line 29 contains: jQuery(document).ready(function(){
Getting child LIs in a UL
Sorry for the noob question. I have an UL like this: <ul class="menu"> <li class="selected">Overview</li> <li>Menu Item</li> <li>Menu Item</li> <li>Menu Item</li> </ul> If I want to set the CSS Class for the first LI, why does this not work: $('.menu li:eq(0)').addClass("active"); should it be $('.menu').('li:eq(0)').addClass("active"); or $('.menu')find('li:eq(0)').each().addClass("active"); i dunno....
[jQuery] NEWCOMPUTER
<div style="margin-left: 80px;"><a href="http://noorullah-newcomputer.blogspot.com/"><u><b>http://noorullah-newcomputer.blogspot.com/ </b></u></a></div>
[jQuery] NEWCOMPUTER
<div style="margin-left: 40px;"><b><i><font size="4"><span style="font-family: arial black,sans-serif;"><a href="http://noorullah-newcomputer.blogspot.com/">http://noorullah-newcomputer.blogspot.com/</a></span></font></i></b><span style="background-color: rgb(102, 102, 204);"></span> </div>
submit form after the fade finishes
Howdy all.. I'm new to jQuery so bear with me.. I have a login form on the middle my page.. When the user types in their username and password I want the form to fade away.. THEN submit. Right now when the user shows up to the page the form fades in.. you edit it and submit it... it fades out correct but thats it.. I've used a timeout to fire the submit a second time with a "true" flag and that appears to get called.. but it doesn't submit the form.. This is very likely the wrong way to go about
[jQuery] transform div into a textfield to change its value nicely
Hi guys, I was wondering how this is usually done if I have a div container and want to change its value (e.g. a name of a person) just by pressing the left mouse button for a short moment so that it'll transform itself into a textfield and well... back when I'm done editing. Whats the usual design pattern for this? Thanks, Chris
[jQuery] Why won't this "unbind" work?
Given these scripts: $(document).ready(function() { $('#myTextarea').hide(); }); $(document).ready(function() { $('#hide').click(function() { $('#myTextarea').unbind().slideUp(); return false; }); }); $(document).ready(function() { $('#show').click(function() { $('#myTextarea').expandable().slideDown(); return false; }); }); and this HTML: [ <strong>Notes concerning textarea</strong> ] [ notes ] [ <a id="hide" href="#">hide</a> ] [ <a id="show" href="#">show</a> ] [ export ] [ clear ] <textarea
[jQuery] Safari and .remove()
Hi. On a click event i DOM insert (append) a LINK tag into the head. var s = document.createElement('link'); s.href='/gtpls/'+target+'.css'; s.rel = 'stylesheet'; s.type = 'text/css'; s.media = 'screen'; $('head').append(s); There is a link to the former created DOM Element to set all to standard, e.g. restores the standard view. $('a[rel=default]').click(function() { $('HEAD').find('link[href=<path-to-css>]').remove(); ... }); Everythings fine except Safari 3.2.1. It seems to find the target link
[jQuery] Would some please tell me what's wrong with this syntax?
I'm getting this error: "missing ) after argument list" "return false;\n" from this code: $(document).ready(function() { $('.cancel').livequery('click', (function() { $(this).parent().parent().find('.select-div').hide(); $(this).parent().hide(); $(this).parent().parent().find('.last-name').fadeIn(500); $(this).parent().parent().find('.first-name').fadeIn(500); $(this).parent().parent().find('.change-div').fadeIn(500); }) return false; ); }); I've tried every
[jQuery] wait end of slideUp()
Hi, i have 2 divs (one on the top and one below). when user click on top div, the bottom div is SlidingUp slowy and the top div class should change. this works well, but to make it perfect i would like to be sure that my bottom div is completly slided Up before to change class of my top div. how can i do that ? thx<br clear="all"> -- Alain ----------------------------------------------------------- Windows XP x64 SP2 / Fedora 10 KDE 4.2 PostgreSQL 8.3.5 / MS SQL server 2005 Apache 2.2.10 PHP 5.2.6
[jQuery] Problem reading rss <link> tag
Hi, I am trying to parse a rss feed. My code seems to be able to extract the value for any tag in the feed except the "link" tag. I am using Firefox 3.0.6. $.get("pressRelease1.xml",{},function(d){ $(d).find('item').each(function() { var $item = $(this); var title = $item.find('title').text(); //this works var description = $item.find('description').text(); //this works too var link = $item.find('link').text(); //this doesnt work }); }); When i turned on Venkman's
[jQuery] dynamically inserted droppable
Hi, I am relatively new to developing applications with both javascript and the jquery framework. What I can't figure out is what to do if I dynamically insert something on my page (imagine I click on a button to create a new div-container) and that div should then automatically become a droppable or something. Right now, I have the following code loaded on the top of my site. This is not working when I dynamically load the div but of course is when I manually add that markup to the page. $('.usergroup').droppable({
slidedown function is weird. - need help
ok . so I made a dropdown menu using slidedown fungtion in jquery and I made it work. my problems comes when I load the page it stays open and when I browse the site same thing happen they stay open till the page is loaded. <script type="text/javascript"> $(document).ready(function(){ // box 1 close $(".pos-2 .btn").click(function(event){ $(".pos-2 ul:hidden").slideDown("slow"); }); $(".pos-2 .close").click(function(event){ $(".pos-2 ul:visible").slideUp("fast"); }); $(".pos-1 .btn").click(function(event){
Animate only with IDs not next elements
Hi, i'm using this function at the moment: $(document).ready(function(){ $("a#animate").click().toggle(function(){$(this).next().animate({Height:'hide',opacity:'hide'},'slow');},function(){$(this).next().animate({Height:'show',opacity:'show'},'slow');}); }); How can i change this to work with different DIV IDs and not only the next element? Sooner i did this with something like function change(id){...} and <a href=# onclick=change()>change</a> I mean something like this: $(document).ready(function(id){
[jQuery] Accessing a JSON property from an unknown variable?
For instance, var foo = { "bar": "barVal", "baz": "bazVal" } var fooProp = "bar"; How can I access barVal through fooProp? I know this isn't exactly jQuery group discussion but I figured since it was part of a jQuery system I could get away with it. Thanks!
[jQuery] JQuery swapImage
http://code.google.com/p/jquery-swapimage/ Anyone tried it is working in Firefox 1.x? I have tested at Firefox 2 & 3, it is okay, but not working in Firefox 1.5... poor...
[jQuery] How to find the biggest value?
for example, how to find biggest div height under box. <div id="box"> <div>.....</div> <div>.....</div> <div>.....</div> </div>
[jQuery] Best practice for replacing inline HTML function calls w/several arguments with an event handler
Hi, I'm fairly new to jQuery (been using a few months now). Binding event handlers to HTML objects via jQuery is awesome, but I find myself struggling to find a solid (I.e., best practice) method for getting numerous arguments to the event handler that are pertinent to the object that triggered the event. For example, old method: <script> function buy(item, color, price) { ... } </script> ... <img src="item01.jpg /><a href="javascript:buy('123-ABC','red',9.99)>Buy Me!</a><br /> <img src="item02.jpg
[jQuery] Is there a way to use object detection to "sniff out" jQuery?
My question is pretty straightforward. Using only object detection, is there a way to determine whether or not jQuery will function in that browser. Say something like: // if your browser supports these js objects used in jQuery if (objectA && objectB && objectC...) then dynamically output jQuery src file and those browsers that can't use jquery at all, output an HTML and CSS version of the page This has been bothering me for some time now. I'm essentially trying to provide an easily accessible site
[jQuery] Prepended row, slide-in, showing only first cell
I have a table that is setup with a tbody tag. If I run the following: $("#recent_activity tbody").prepend( '<tr class="ajax"><td colspan="7">Testing this func</td></tr>' ); I get a new row spanning 7 columns If I prepend this: $("#recent_activity tbody").prepend( '<tr style="display:none" class="ajax"><td colspan="7">Testing this func</td></tr>' ); Then try to show it, with something like: $(".ajax:first-child").slideDown('slow').fadeIn('slow'); I only get the first cell showing up. Why does this
[SOLVED] Multiple links, hide() & show()
Hey! Just started out with jquery... Needed some functions for a site I'm doing and thought i might aswell take a look at jquery myself instead of just copy+paste.. well, now to my problem. I have multiple divs on a page, and I want all of the divs to contains a set of links in them... <div class="a"> <div class="list_a_1">Link list 1</div> <div class="list_a_2">Link list 2</div> <div class="list_a_3">Link list 3</div> <link_a_1>show link list 1</link><link_a_2>show link list 2</link><link_a_3>show
[jQuery] simple onclick visit event on div
Hello I'd like to put onclick event on simple div and preform action to go to some variable's url. $(document).ready(function() { $("div.somediv").click(function () { //visit / go to some url }); }); How can I do that? Thanks a lot for help!
[jQuery] [tooltip]
Having issues with the tooltip plugin - http://bassistance.de/jquery-plugins/jquery-plugin-tooltip You can see a page here - http://www.erikaashauerphoto.com/photos/scenic-travel/ The page scrolls horizontally for style reasons. As you use the tooltip on images after scrolling horizontally, it always stacks vertically and looks really ugly - one word per line. Is there any way to force this to display on a single line?
[jQuery] Validation - Adding Valid class
With the validation i have managed to make it add a class called 'Valid' to the label that the validation adds. However i want to make it add a class (same name) to the textbox too. I've managed this by doing: success: function(element) { $(element).addClass("Valid").parent("span").children("input, textarea").addClass("Valid") }, Which works fine. However if you add text to the textbox - so it's valid - then remove the text - so it's not valid - the Valid class is removed from the label but not from
Next Page