jquery

JQuery Check to See if Div is Shown

This is what I am ultimately trying to achieve: //When the user clicks the liveshow button this happens $(".liveshow-button").live('click', function() { if ($(".liveshowDiv2").css('display') == 'none') { $(".liveshowDiv2").fadeOut(ifadeOutSpeed, function() { $('#wrapper-div').animate({ height: $('...

How would I stop a live jquery event handler from firing more than once?

Greetings. I'm trying to post-process content that is added to the DOM via the excellent SyntaxHighlighter project. When SH formats text, it generates a bunch of HTML and then writes that HTML into the DOM. It creates a div with class "syntaxhighlighter". I want to listen for the insertion of these new divs, and when they are inserted...

jquery length of text()

Hi, What's wrong with the below <html> <body> <div id='test')28</div> </body> </html> <script> $(document).ready(function (){ if ($('#test').text().length() > 0) // error here? alert("test"); }); I get a javascript error in I.E 6 saying function expected on the line marked error..? ...

How to change an image when clicked using JavaScript?

Hello! I've created a sliding image viewer here. As you can see, there's 4 small clickable images to change/slide the image. I want the small image to change to this image when it's clicked, or when the appropriate main image is showing. That way the users can tell which main image is being shown. Can anyone maybe look at the source and...

jquery datatables stuck on AJAX server side table

All, Wondering if someone could help. I've been using DataTables quite some time both via dom manipulation and JSON code. However, two of our larger resultsets are still running too slow, so I'm attempting to convert them over to client-side data sources. I have the table there, with headers, but the data is not being injected into ...

Edit links in place

I use this javascript to edit text in place: http://josephscott.org/code/javascript/jquery-edit-in-place now I need to edit links as well. But when I click on link instead of just making it editable I'm redirected to the link address. How can I change it so that if double click a link just make it editable and don't redirect anywhere? C...

jquery draggable -- animate "clone" on drop

I'm building a widget which allows user to copy items from one list over to another, but dragging. I've figured out the helper: 'clone' option will allow me to drag a copy of my draggable, rather than the draggable itself. I'd like to have the clone animate/snap in to place when I drop it on my droppable, but it seems to be destroyed as...

jQuery undefined in content page when using master pages which has jQuery reference

I have a nested master page. A parent master page, a child master page and a content page whose master page is the child master page. I have a reference to jQuery in the parent master page in the head section.<script type="text/javascript" src='<%#ResolveUrl("~/includes/jquery-1.4.2.min.js") %>' ></script> & Page.Header.DataBind(); in th...

What would be better to use in this case? c# or php?

I am making a website where users can upload pictures and draw on them, add text etc. My team knows some php, but we know nothing about c#. Time is not too much of an issue. We all know java, what would the perks of each be? I have been hearing that c# will be much better for handling the canvas because there is a lot more libraries ...

Help need to merge two functions for jquery cycle?

I have two functions I would like to use in my before callback with jquery cycle. One slides the pager over as the user cycles through, and other other centers the image horizontally and vertically inside the containing div. Both work great separately, yet I can seem to get them to work together both on the before callback. I have an exa...

Expand Table Row to show content within table Jquery Plugin

I came across this plugin a while back and never bookmarked it. I was hoping someone might know the name of it or link me up. The plugin is for a table and it allows you expand on each row within the table. So if you click the "View" button within a table row then the table would open up on that row and there would be some sort of cont...

Detecting browser with JQuery

Hi Guys, I am trying to use jQuery(document).ready(function () { if (!jQuery.browser.msie <= 7.99) { jQuery('#element').css('display', 'block'); } }); But it doesn't appear to work ? What am I doing wrong ? Thx Edit: Use conditional comments <!--[if !IE]> <!--[if lt IE 8]> //do stuff <![en...

JQuery Toggle image AND another div height

Not sure if this can be done, but I would like to toggle an image (easy) BUT at the same time increase/decrease the height of another div based on the "open/close" of the toggle. I can get it to increase on click, but not on the "close" any suggestions please $j('#headerImageToggle').live('click',function(){ $j(this).next('div').slideT...

asp.net checkbox converted to three-state checkbox, not hitting original event handler

Hi, I have a usercontrol with an asp.net checkbox in it. I'm attempting to write a jquery script to convert that normal checkbox into a three-state checkbox. The states are 'checked', 'unchecked', and 'intermediate'. Clicking on an intermediate state should change the state to checked, clicking on an unchecked state should change the ...

[jQuery & jQuery Tools] Loading content with ajax while scrolling

I'm using jQuery Tools Plugin as image slider (image here), but due to large amount of images I need to load them few at a time. Since it's javascript coded, I can't have the scroll position as far as I know. I want to load them as soon as the last image shows up or something like that. I have no idea where I put and event listener neith...

Using more then 1 item for a .click()

Is this possible? Code: $('#goRightBtn').click(function() { Random code here }; I have a button, when you click that button (goRightBtn) it will do all of the functions and whatnot inside that code up there. But I also have another button that will do the exact same thing (don't ask why.. Just need it!) How do I make it so t...

closing the Jquery Dialog On form Submission

$('#srch').click(function(e){ if ($("#form").validationEngine({returnIsValid:true})) { $("#loader").dialog('open'); $.ajax({ type: "GET", url: "/cdr/abc.php", cache: false, data: $("#srch").serialize(), timeout: 5000, error: function (XMLHttpReq...

How to print value of .hasClass via console?

Hi, using the Firebug console I'm trying to test whether this code is working: $(window).bind("load", function() { $('#tab1link').click(function() { $('#tab2').hide(); $('#tab2').removeClass('selected'); $('#tab1').show(); $('#tab1').addClass('selected'); }); $('#tab2link').click(function() {...

How to make JQuery TreeView nodes into links?

Hi all, I've just created a navigation tree for a help page using ASP.NET MVC and JQuery TreeView. I can't figure out how to add links to the child nodes. What I want to do is add a property to my model (string linkText) so I can set it in each child node and turn them into links. Inserting an a tag between li tags needs to be done in...

Echoing <script> from PHP to jQuery AJAX causes problems with my interval

Basically, I'm grabbing contents from a PHP file. I check it every 5 seconds. If the content differs from the content on the page, it loads that new content: <script type="text/javascript"> $(document).ready(function() { $.ajaxSetup ({ cache: false }); var loadUrl = "<?php echo site_url("admin/get_uploads"...